summaryrefslogtreecommitdiff
path: root/spec/frontend/pages/projects/forks/new/components/app_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/pages/projects/forks/new/components/app_spec.js')
-rw-r--r--spec/frontend/pages/projects/forks/new/components/app_spec.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/frontend/pages/projects/forks/new/components/app_spec.js b/spec/frontend/pages/projects/forks/new/components/app_spec.js
new file mode 100644
index 00000000000..e1820606704
--- /dev/null
+++ b/spec/frontend/pages/projects/forks/new/components/app_spec.js
@@ -0,0 +1,42 @@
+import { shallowMount } from '@vue/test-utils';
+import App from '~/pages/projects/forks/new/components/app.vue';
+
+describe('App component', () => {
+ let wrapper;
+
+ const DEFAULT_PROPS = {
+ forkIllustration: 'illustrations/project-create-new-sm.svg',
+ endpoint: '/some/project-full-path/-/forks/new.json',
+ projectFullPath: '/some/project-full-path',
+ projectId: '10',
+ projectName: 'Project Name',
+ projectPath: 'project-name',
+ projectDescription: 'some project description',
+ projectVisibility: 'private',
+ };
+
+ const createComponent = (props = {}) => {
+ wrapper = shallowMount(App, {
+ propsData: {
+ ...DEFAULT_PROPS,
+ ...props,
+ },
+ });
+ };
+
+ beforeEach(() => {
+ createComponent();
+ });
+
+ afterEach(() => {
+ wrapper.destroy();
+ });
+
+ it('displays the correct svg illustration', () => {
+ expect(wrapper.find('img').attributes('src')).toBe('illustrations/project-create-new-sm.svg');
+ });
+
+ it('renders ForkForm component with prop', () => {
+ expect(wrapper.props()).toEqual(expect.objectContaining(DEFAULT_PROPS));
+ });
+});