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
5f514d11
Commit
5f514d11
authored
Apr 30, 2020
by
Emily Ring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated terraform-mr tests
Added changelog for MR Added poll test for mr_widget_terraform_plan vue
parent
7fda8195
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
changelogs/unreleased/emilyring-terraform-mr-fix.yml
changelogs/unreleased/emilyring-terraform-mr-fix.yml
+5
-0
spec/frontend/vue_mr_widget/components/mr_widget_terraform_plan_spec.js
...vue_mr_widget/components/mr_widget_terraform_plan_spec.js
+18
-0
No files found.
changelogs/unreleased/emilyring-terraform-mr-fix.yml
0 → 100644
View file @
5f514d11
---
title
:
Remove Visibility from terraform widget
merge_request
:
30737
author
:
type
:
fixed
spec/frontend/vue_mr_widget/components/mr_widget_terraform_plan_spec.js
View file @
5f514d11
...
...
@@ -3,6 +3,7 @@ import { shallowMount } from '@vue/test-utils';
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MrWidgetTerraformPlan
from
'
~/vue_merge_request_widget/components/mr_widget_terraform_plan.vue
'
;
import
Poll
from
'
~/lib/utils/poll
'
;
const
plan
=
{
create
:
10
,
...
...
@@ -57,11 +58,23 @@ describe('MrWidgetTerraformPlan', () => {
});
describe
(
'
successful poll
'
,
()
=>
{
let
pollRequest
;
let
pollStop
;
beforeEach
(()
=>
{
pollRequest
=
jest
.
spyOn
(
Poll
.
prototype
,
'
makeRequest
'
);
pollStop
=
jest
.
spyOn
(
Poll
.
prototype
,
'
stop
'
);
mockPollingApi
(
200
,
{
'
tfplan.json
'
:
plan
},
{});
return
mountWrapper
();
});
afterEach
(()
=>
{
pollRequest
.
mockRestore
();
pollStop
.
mockRestore
();
});
it
(
'
content change text
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlSprintf
).
exists
()).
toBe
(
true
);
});
...
...
@@ -69,6 +82,11 @@ describe('MrWidgetTerraformPlan', () => {
it
(
'
renders button when url is found
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
a
'
).
text
()).
toContain
(
'
View full log
'
);
});
it
(
'
does not make additional requests after poll is successful
'
,
()
=>
{
expect
(
pollRequest
).
toHaveBeenCalledTimes
(
1
);
expect
(
pollStop
).
toHaveBeenCalledTimes
(
1
);
});
});
describe
(
'
polling fails
'
,
()
=>
{
...
...
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