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
9f5cf35e
Commit
9f5cf35e
authored
Dec 28, 2020
by
jboyson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove direct mod of Vue instance
parent
7d2741f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
spec/frontend/diffs/components/diff_file_spec.js
spec/frontend/diffs/components/diff_file_spec.js
+9
-1
No files found.
spec/frontend/diffs/components/diff_file_spec.js
View file @
9f5cf35e
import
Vuex
from
'
vuex
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
httpStatus
from
'
~/lib/utils/http_status
'
;
import
createDiffsStore
from
'
~/diffs/store/modules
'
;
import
createNotesStore
from
'
~/notes/stores/modules
'
;
import
diffFileMockDataReadable
from
'
../mock_data/diff_file
'
;
...
...
@@ -118,14 +121,17 @@ const changeViewerType = (store, newType, index = 0) =>
describe
(
'
DiffFile
'
,
()
=>
{
let
wrapper
;
let
store
;
let
axiosMock
;
beforeEach
(()
=>
{
axiosMock
=
new
MockAdapter
(
axios
);
({
wrapper
,
store
}
=
createComponent
({
file
:
getReadableFile
()
}));
});
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
axiosMock
.
restore
();
});
describe
(
'
bus events
'
,
()
=>
{
...
...
@@ -353,8 +359,10 @@ describe('DiffFile', () => {
describe
(
'
loading
'
,
()
=>
{
it
(
'
should have loading icon while loading a collapsed diffs
'
,
async
()
=>
{
const
{
load_collapsed_diff_url
}
=
store
.
state
.
diffs
.
diffFiles
[
0
];
axiosMock
.
onGet
(
load_collapsed_diff_url
).
reply
(
httpStatus
.
OK
,
getReadableFile
());
makeFileAutomaticallyCollapsed
(
store
);
wrapper
.
vm
.
isLoadingCollapsedDiff
=
true
;
wrapper
.
vm
.
requestDiff
()
;
await
wrapper
.
vm
.
$nextTick
();
...
...
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