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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
d1e80a82
Commit
d1e80a82
authored
Jul 21, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add repo_prev_directory spec and improve a repo_file spec assertion
parent
e481cdf5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
spec/javascripts/repo/repo_file_spec.js
spec/javascripts/repo/repo_file_spec.js
+1
-1
spec/javascripts/repo/repo_prev_directory_spec.js
spec/javascripts/repo/repo_prev_directory_spec.js
+30
-0
No files found.
spec/javascripts/repo/repo_file_spec.js
View file @
d1e80a82
...
...
@@ -102,6 +102,6 @@ describe('RepoFile', () => {
vm
.
$el
.
querySelector
(
'
.repo-file-name
'
).
click
();
expect
(
vm
.
linkClicked
).
toHaveBeenCalled
(
);
expect
(
vm
.
linkClicked
).
toHaveBeenCalled
With
(
file
);
});
});
spec/javascripts/repo/repo_prev_directory_spec.js
0 → 100644
View file @
d1e80a82
import
Vue
from
'
vue
'
;
import
repoPrevDirectory
from
'
~/repo/repo_prev_directory.vue
'
;
describe
(
'
RepoPrevDirectory
'
,
()
=>
{
const
RepoPrevDirectory
=
Vue
.
extend
(
repoPrevDirectory
);
function
createComponent
(
propsData
)
{
return
new
RepoPrevDirectory
({
propsData
,
}).
$mount
();
}
it
(
'
renders a prev dir link
'
,
()
=>
{
const
prevUrl
=
'
prevUrl
'
;
const
vm
=
createComponent
({
prevUrl
,
});
const
link
=
vm
.
$el
.
querySelector
(
'
a
'
);
spyOn
(
vm
,
'
linkClicked
'
);
expect
(
link
).
toBeTruthy
();
expect
(
link
.
href
).
toMatch
(
`/
${
prevUrl
}
`
);
expect
(
link
.
textContent
).
toEqual
(
'
..
'
);
link
.
click
();
expect
(
vm
.
linkClicked
).
toHaveBeenCalledWith
(
prevUrl
);
});
});
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