diff options
Diffstat (limited to 'spec/frontend/static_site_editor/components/app_spec.js')
-rw-r--r-- | spec/frontend/static_site_editor/components/app_spec.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/frontend/static_site_editor/components/app_spec.js b/spec/frontend/static_site_editor/components/app_spec.js new file mode 100644 index 00000000000..bbdffeae68f --- /dev/null +++ b/spec/frontend/static_site_editor/components/app_spec.js @@ -0,0 +1,34 @@ +import { shallowMount } from '@vue/test-utils'; +import App from '~/static_site_editor/components/app.vue'; + +describe('static_site_editor/components/app', () => { + const mergeRequestsIllustrationPath = 'illustrations/merge_requests.svg'; + const RouterView = { + template: '<div></div>', + }; + let wrapper; + + const buildWrapper = () => { + wrapper = shallowMount(App, { + stubs: { + RouterView, + }, + propsData: { + mergeRequestsIllustrationPath, + }, + }); + }; + + afterEach(() => { + wrapper.destroy(); + wrapper = null; + }); + + it('passes merge request illustration path to the router view component', () => { + buildWrapper(); + + expect(wrapper.find(RouterView).attributes()).toMatchObject({ + 'merge-requests-illustration-path': mergeRequestsIllustrationPath, + }); + }); +}); |