Commit 332815d6 authored by Paul Slaughter's avatar Paul Slaughter

fixup! Add/remove snippet files in the edit view

parent 6e7b56e2
...@@ -15,7 +15,7 @@ export default { ...@@ -15,7 +15,7 @@ export default {
canDelete: { canDelete: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false, default: true,
}, },
showDelete: { showDelete: {
type: Boolean, type: Boolean,
......
...@@ -14,8 +14,6 @@ export default { ...@@ -14,8 +14,6 @@ export default {
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
props: { props: {
// TODO: Build reactivity for initBlobs.
// What happens if this changes (i.e. blobs are being loaded through pages)?
initBlobs: { initBlobs: {
type: Array, type: Array,
required: true, required: true,
......
...@@ -56,9 +56,9 @@ describe('Blob Header Editing', () => { ...@@ -56,9 +56,9 @@ describe('Blob Header Editing', () => {
}); });
describe.each` describe.each`
props | expectedDisabled props | expectedDisabled
${{ showDelete: true }} | ${true} ${{ showDelete: true }} | ${false}
${{ showDelete: true, canDelete: true }} | ${false} ${{ showDelete: true, canDelete: false }} | ${true}
`('with $props', ({ props, expectedDisabled }) => { `('with $props', ({ props, expectedDisabled }) => {
beforeEach(() => { beforeEach(() => {
createComponent(props); createComponent(props);
......
...@@ -217,7 +217,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => { ...@@ -217,7 +217,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => {
describe('with 1 blob', () => { describe('with 1 blob', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ initBlobs: [createBlobFromTestEntry(testEntries.created)], isReady: true }); createComponent({ initBlobs: [createBlobFromTestEntry(testEntries.created)] });
}); });
it('disables delete button', () => { it('disables delete button', () => {
...@@ -253,7 +253,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => { ...@@ -253,7 +253,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => {
describe('with 0 init blob', () => { describe('with 0 init blob', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ initBlobs: [], isReady: true }); createComponent({ initBlobs: [] });
}); });
it('shows 1 blob by default', () => { it('shows 1 blob by default', () => {
...@@ -287,7 +287,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => { ...@@ -287,7 +287,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => {
.fill(1) .fill(1)
.map(() => createBlobFromTestEntry(testEntries.created)); .map(() => createBlobFromTestEntry(testEntries.created));
createComponent({ initBlobs, isReady: true }); createComponent({ initBlobs });
}); });
it('should have blobs', () => { it('should have blobs', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment