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
557c40b0
Commit
557c40b0
authored
Jan 12, 2022
by
vvempati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made reusable constants for plan query mocks
parent
a9525646
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js
ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js
+6
-18
No files found.
ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js
View file @
557c40b0
...
...
@@ -83,9 +83,8 @@ describe('Buy Addons Shared App', () => {
describe
(
'
Storage
'
,
()
=>
{
describe
(
'
when data is received
'
,
()
=>
{
beforeEach
(()
=>
{
const
mockApollo
=
createMockApolloProvider
({
plansQueryMock
:
jest
.
fn
().
mockResolvedValue
({
data
:
{
plans
:
mockStoragePlans
}
}),
});
const
plansQueryMock
=
jest
.
fn
().
mockResolvedValue
({
data
:
{
plans
:
mockStoragePlans
}
});
const
mockApollo
=
createMockApolloProvider
({
plansQueryMock
});
return
createComponent
(
mockApollo
,
STORAGE_ADDON_PROPS
);
});
...
...
@@ -167,10 +166,9 @@ describe('Buy Addons Shared App', () => {
});
describe
(
'
labels
'
,
()
=>
{
const
plansQueryMock
=
jest
.
fn
().
mockResolvedValue
({
data
:
{
plans
:
mockStoragePlans
}
});
it
(
'
shows labels correctly for 1 pack
'
,
async
()
=>
{
const
mockApollo
=
createMockApolloProvider
({
plansQueryMock
:
jest
.
fn
().
mockResolvedValue
({
data
:
{
plans
:
mockStoragePlans
}
}),
});
const
mockApollo
=
createMockApolloProvider
({
plansQueryMock
});
await
createComponent
(
mockApollo
,
STORAGE_ADDON_PROPS
);
expect
(
findQuantityText
().
text
()).
toMatchInterpolatedText
(
...
...
@@ -182,12 +180,7 @@ describe('Buy Addons Shared App', () => {
});
it
(
'
shows labels correctly for 2 packs
'
,
async
()
=>
{
const
mockApollo
=
createMockApolloProvider
(
{
plansQueryMock
:
jest
.
fn
().
mockResolvedValue
({
data
:
{
plans
:
mockStoragePlans
}
}),
},
{
quantity
:
2
},
);
const
mockApollo
=
createMockApolloProvider
({
plansQueryMock
},
{
quantity
:
2
});
await
createComponent
(
mockApollo
,
STORAGE_ADDON_PROPS
);
expect
(
findQuantityText
().
text
()).
toMatchInterpolatedText
(
...
...
@@ -198,12 +191,7 @@ describe('Buy Addons Shared App', () => {
});
it
(
'
does not show labels if input is invalid
'
,
async
()
=>
{
const
mockApollo
=
createMockApolloProvider
(
{
plansQueryMock
:
jest
.
fn
().
mockResolvedValue
({
data
:
{
plans
:
mockStoragePlans
}
}),
},
{
quantity
:
-
1
},
);
const
mockApollo
=
createMockApolloProvider
({
plansQueryMock
},
{
quantity
:
-
1
});
await
createComponent
(
mockApollo
,
STORAGE_ADDON_PROPS
);
expect
(
findQuantityText
().
text
()).
toMatchInterpolatedText
(
'
x 10 GB per pack
'
);
...
...
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