Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
592a5273
Commit
592a5273
authored
Apr 01, 2019
by
Phil Hughes
Committed by
Bob Van Landuyt
Apr 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated frontend specs
parent
09639474
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
7 deletions
+68
-7
ee/spec/frontend/design_management/components/upload/__snapshots__/form_spec.js.snap
...agement/components/upload/__snapshots__/form_spec.js.snap
+18
-0
ee/spec/frontend/design_management/components/upload/form_spec.js
...frontend/design_management/components/upload/form_spec.js
+8
-1
ee/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap
.../design_management/pages/__snapshots__/index_spec.js.snap
+12
-4
ee/spec/frontend/design_management/pages/index_spec.js
ee/spec/frontend/design_management/pages/index_spec.js
+25
-1
ee/spec/frontend/design_management/router_spec.js
ee/spec/frontend/design_management/router_spec.js
+5
-1
No files found.
ee/spec/frontend/design_management/components/upload/__snapshots__/form_spec.js.snap
View file @
592a5273
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Design management upload form component hides button if cant upload 1`] = `
<header
class="row-content-block border-top-0 p-2 d-flex"
>
<div>
<!---->
<input
accept="image/*"
class="hide"
multiple="multiple"
name="design_file"
type="file"
/>
</div>
</header>
`;
exports[`Design management upload form component renders loading icon 1`] = `
<header
class="row-content-block border-top-0 p-2 d-flex"
...
...
ee/spec/frontend/design_management/components/upload/form_spec.js
View file @
592a5273
...
...
@@ -4,10 +4,11 @@ import UploadForm from 'ee/design_management/components/upload/form.vue';
describe
(
'
Design management upload form component
'
,
()
=>
{
let
vm
;
function
createComponent
(
isSaving
=
false
)
{
function
createComponent
(
isSaving
=
false
,
canUploadDesign
=
true
)
{
vm
=
shallowMount
(
UploadForm
,
{
propsData
:
{
isSaving
,
canUploadDesign
,
},
});
}
...
...
@@ -24,6 +25,12 @@ describe('Design management upload form component', () => {
expect
(
vm
.
element
).
toMatchSnapshot
();
});
it
(
'
hides button if cant upload
'
,
()
=>
{
createComponent
(
false
,
false
);
expect
(
vm
.
element
).
toMatchSnapshot
();
});
describe
(
'
onFileUploadChange
'
,
()
=>
{
it
(
'
emits upload event
'
,
()
=>
{
createComponent
();
...
...
ee/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap
View file @
592a5273
...
...
@@ -2,7 +2,9 @@
exports[`Design management index page designs renders designs list 1`] = `
<div>
<uploadform-stub />
<uploadform-stub
canuploaddesign="true"
/>
<div
class="mt-4"
...
...
@@ -18,7 +20,9 @@ exports[`Design management index page designs renders designs list 1`] = `
exports[`Design management index page designs renders empty text 1`] = `
<div>
<uploadform-stub />
<uploadform-stub
canuploaddesign="true"
/>
<div
class="mt-4"
...
...
@@ -34,7 +38,9 @@ exports[`Design management index page designs renders empty text 1`] = `
exports[`Design management index page designs renders error 1`] = `
<div>
<uploadform-stub />
<uploadform-stub
canuploaddesign="true"
/>
<div
class="mt-4"
...
...
@@ -54,7 +60,9 @@ exports[`Design management index page designs renders error 1`] = `
exports[`Design management index page designs renders loading icon 1`] = `
<div>
<uploadform-stub />
<uploadform-stub
canuploaddesign="true"
/>
<div
class="mt-4"
...
...
ee/spec/frontend/design_management/pages/index_spec.js
View file @
592a5273
...
...
@@ -3,15 +3,19 @@ import Index from 'ee/design_management/pages/index.vue';
import
uploadDesignQuery
from
'
ee/design_management/queries/uploadDesign.graphql
'
;
describe
(
'
Design management index page
'
,
()
=>
{
const
mutate
=
jest
.
fn
(()
=>
Promise
.
resolve
())
;
let
mutate
;
let
vm
;
function
createComponent
(
loading
=
false
)
{
mutate
=
jest
.
fn
(()
=>
Promise
.
resolve
());
const
$apollo
=
{
queries
:
{
designs
:
{
loading
,
},
permissions
:
{
loading
,
},
},
mutate
,
};
...
...
@@ -20,6 +24,12 @@ describe('Design management index page', () => {
mocks
:
{
$apollo
},
stubs
:
[
'
router-view
'
],
});
vm
.
setData
({
permissions
:
{
createDesign
:
true
,
},
});
}
describe
(
'
designs
'
,
()
=>
{
...
...
@@ -86,6 +96,20 @@ describe('Design management index page', () => {
});
});
it
(
'
does not call apollo mutate if createDesign is false
'
,
()
=>
{
createComponent
();
vm
.
setData
({
permissions
:
{
createDesign
:
false
,
},
});
vm
.
vm
.
onUploadDesign
([]);
expect
(
mutate
).
not
.
toHaveBeenCalled
();
});
it
(
'
sets isSaving
'
,
()
=>
{
createComponent
();
...
...
ee/spec/frontend/design_management/router_spec.js
View file @
592a5273
...
...
@@ -24,7 +24,11 @@ describe('Design management router', () => {
router
,
mocks
:
{
$apollo
:
{
queries
:
{
designs
:
{
loading
:
true
},
design
:
{
loading
:
true
}
},
queries
:
{
designs
:
{
loading
:
true
},
design
:
{
loading
:
true
},
permissions
:
{
loading
:
true
},
},
},
},
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment