Commit 623d484d authored by Tom Quirk's avatar Tom Quirk

Fix tests to check GlAlert use in Design view

parent 79290749
...@@ -21,7 +21,6 @@ import { ...@@ -21,7 +21,6 @@ import {
DESIGN_NOT_EXIST_ERROR, DESIGN_NOT_EXIST_ERROR,
designDeletionError, designDeletionError,
} from '../../utils/error_messages'; } from '../../utils/error_messages';
import DESIGN_DETAIL_CONTAINER_CLASS from '../../utils/constants';
export default { export default {
components: { components: {
...@@ -198,7 +197,6 @@ export default { ...@@ -198,7 +197,6 @@ export default {
next(); next();
}, },
createImageDiffNoteMutation, createImageDiffNoteMutation,
DESIGN_DETAIL_CONTAINER_CLASS,
}; };
</script> </script>
......
const DESIGN_DETAIL_CONTAINER_CLASS = 'design-detail';
export default DESIGN_DETAIL_CONTAINER_CLASS;
...@@ -19,9 +19,20 @@ exports[`Design management design index page flash container is in correct posit ...@@ -19,9 +19,20 @@ exports[`Design management design index page flash container is in correct posit
<div <div
class="p-3" class="p-3"
> >
<div <glalert-stub
class="flash-container" dismissible="true"
/> dismisslabel="Dismiss"
primarybuttonlink=""
primarybuttontext=""
secondarybuttonlink=""
secondarybuttontext=""
title=""
variant="danger"
>
woops
</glalert-stub>
</div> </div>
<designimage-stub <designimage-stub
......
...@@ -188,23 +188,17 @@ describe('Design management design index page', () => { ...@@ -188,23 +188,17 @@ describe('Design management design index page', () => {
edges: [], edges: [],
}, },
}, },
errorMessage: 'woops',
}); });
}); });
it('container is in correct position in DOM', () => { it('container is in correct position in DOM', () => {
wrapper.vm.$nextTick(() => { expect(wrapper.element).toMatchSnapshot();
// tests that `design-detail` class exists on Component container,
// and that the '.flash-container' element exists and is placed correctly // wrapper.vm.$nextTick(() => {
expect(wrapper.element).toMatchSnapshot(); // // tests that `design-detail` class exists on Component container,
}); // // and that the '.flash-container' element exists and is placed correctly
}); // expect(wrapper.element).toMatchSnapshot();
it('creates flash on mutation error', () => { // });
utils.createDesignDetailFlash = jest.fn();
try {
wrapper.vm.onMutationError('test error');
} catch (e) {
expect(utils.createDesignDetailFlash).toHaveBeenCalled();
}
}); });
}); });
}); });
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