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
17d96b2c
Commit
17d96b2c
authored
Apr 15, 2021
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic spec for subscriptions_list.vue
parent
5ec4c4ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
spec/frontend/jira_connect/components/subscriptions_list_spec.js
...ontend/jira_connect/components/subscriptions_list_spec.js
+42
-0
spec/frontend/jira_connect/mock_data.js
spec/frontend/jira_connect/mock_data.js
+6
-0
No files found.
spec/frontend/jira_connect/components/subscriptions_list_spec.js
0 → 100644
View file @
17d96b2c
import
{
GlEmptyState
,
GlTable
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
SubscriptionsList
from
'
~/jira_connect/components/subscriptions_list.vue
'
;
import
{
mockSubscription
}
from
'
../mock_data
'
;
describe
(
'
SubscriptionsList
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
({
provide
=
{}
}
=
{})
=>
{
wrapper
=
shallowMount
(
SubscriptionsList
,
{
provide
,
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
});
const
findGlEmptyState
=
()
=>
wrapper
.
findComponent
(
GlEmptyState
);
const
findGlTable
=
()
=>
wrapper
.
findComponent
(
GlTable
);
describe
(
'
template
'
,
()
=>
{
it
(
'
renders GlEmptyState when subscriptions is empty
'
,
()
=>
{
createComponent
();
expect
(
findGlEmptyState
().
exists
()).
toBe
(
true
);
expect
(
findGlTable
().
exists
()).
toBe
(
false
);
});
it
(
'
renders GlTable when subscriptions are present
'
,
()
=>
{
createComponent
({
provide
:
{
subscriptions
:
[
mockSubscription
],
},
});
expect
(
findGlEmptyState
().
exists
()).
toBe
(
false
);
expect
(
findGlTable
().
exists
()).
toBe
(
true
);
});
});
});
spec/frontend/jira_connect/mock_data.js
View file @
17d96b2c
...
...
@@ -15,3 +15,9 @@ export const mockGroup2 = {
full_path
:
'
gitlab-com
'
,
description
:
'
For GitLab company related projects
'
,
};
export
const
mockSubscription
=
{
group
:
mockGroup1
,
created_at
:
'
2021-04-14T08:52:23.115Z
'
,
unlink_path
:
'
/-/jira_connect/subscriptions/1
'
,
};
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