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
e74be1cc
Commit
e74be1cc
authored
Jan 11, 2022
by
vvempati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prettify changed files
parent
470b4983
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js
ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js
+12
-6
ee/spec/frontend/subscriptions/spec_helper.js
ee/spec/frontend/subscriptions/spec_helper.js
+1
-4
No files found.
ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js
View file @
e74be1cc
...
...
@@ -166,9 +166,12 @@ describe('Buy Addons Shared App', () => {
});
it
(
'
shows labels correctly for 2 packs
'
,
async
()
=>
{
const
mockApollo
=
createMockApolloProvider
({
const
mockApollo
=
createMockApolloProvider
(
{
plansQueryMock
:
jest
.
fn
().
mockResolvedValue
({
data
:
{
plans
:
mockStoragePlans
}
}),
},
{
quantity
:
2
});
},
{
quantity
:
2
},
);
await
createComponent
(
mockApollo
,
STORAGE_ADDON_PROPS
);
expect
(
findQuantityText
().
text
()).
toMatchInterpolatedText
(
...
...
@@ -179,9 +182,12 @@ describe('Buy Addons Shared App', () => {
});
it
(
'
does not show labels if input is invalid
'
,
async
()
=>
{
const
mockApollo
=
createMockApolloProvider
({
const
mockApollo
=
createMockApolloProvider
(
{
plansQueryMock
:
jest
.
fn
().
mockResolvedValue
({
data
:
{
plans
:
mockStoragePlans
}
}),
},
{
quantity
:
-
1
});
},
{
quantity
:
-
1
},
);
await
createComponent
(
mockApollo
,
STORAGE_ADDON_PROPS
);
expect
(
findQuantityText
().
text
()).
toMatchInterpolatedText
(
'
x 10 GB per pack
'
);
...
...
ee/spec/frontend/subscriptions/spec_helper.js
View file @
e74be1cc
...
...
@@ -4,10 +4,7 @@ import plansQuery from 'ee/subscriptions/graphql/queries/plans.customer.query.gr
import
orderPreviewQuery
from
'
ee/subscriptions/graphql/queries/order_preview.customer.query.graphql
'
;
import
{
createMockClient
}
from
'
helpers/mock_apollo_helper
'
;
import
{
CUSTOMERSDOT_CLIENT
}
from
'
ee/subscriptions/buy_addons_shared/constants
'
;
import
{
mockDefaultCache
,
mockOrderPreview
,
}
from
'
ee_jest/subscriptions/mock_data
'
;
import
{
mockDefaultCache
,
mockOrderPreview
}
from
'
ee_jest/subscriptions/mock_data
'
;
export
function
createMockApolloProvider
(
mockResponses
=
{},
dataset
=
{})
{
const
{
...
...
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