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
f9c0135d
Commit
f9c0135d
authored
Jul 15, 2021
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for ide_project_header.vue
parent
0037cd80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
app/assets/javascripts/ide/components/ide_project_header.vue
app/assets/javascripts/ide/components/ide_project_header.vue
+1
-1
spec/frontend/ide/components/ide_project_header_spec.js
spec/frontend/ide/components/ide_project_header_spec.js
+44
-0
No files found.
app/assets/javascripts/ide/components/ide_project_header.vue
View file @
f9c0135d
...
...
@@ -16,7 +16,7 @@ export default {
<
template
>
<div
class=
"context-header ide-context-header"
>
<a
:href=
"project.web_url"
:title=
"s__('IDE|Go to project')"
>
<a
:href=
"project.web_url"
:title=
"s__('IDE|Go to project')"
data-testid=
"go-to-project-link"
>
<project-avatar
:project-name=
"project.name"
:project-avatar-url=
"project.avatar_url"
...
...
spec/frontend/ide/components/ide_project_header_spec.js
0 → 100644
View file @
f9c0135d
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
IDEProjectHeader
from
'
~/ide/components/ide_project_header.vue
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/project_avatar.vue
'
;
const
mockProject
=
{
name
:
'
test proj
'
,
avatar_url
:
'
https://gitlab.com
'
,
path_with_namespace
:
'
path/with-namespace
'
,
web_url
:
'
https://gitlab.com/project
'
,
};
describe
(
'
IDE project header
'
,
()
=>
{
let
wrapper
;
const
findProjectAvatar
=
()
=>
wrapper
.
findComponent
(
ProjectAvatar
);
const
findProjectLink
=
()
=>
wrapper
.
find
(
'
[data-testid="go-to-project-link"
'
);
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
IDEProjectHeader
,
{
propsData
:
{
project
:
mockProject
}
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
});
describe
(
'
template
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
();
});
it
(
'
renders ProjectAvatar with correct props
'
,
()
=>
{
expect
(
findProjectAvatar
().
props
()).
toMatchObject
({
projectName
:
mockProject
.
name
,
projectAvatarUrl
:
mockProject
.
avatar_url
,
});
});
it
(
'
renders a link to the project URL
'
,
()
=>
{
const
link
=
findProjectLink
();
expect
(
link
.
exists
()).
toBe
(
true
);
expect
(
link
.
attributes
(
'
href
'
)).
toBe
(
mockProject
.
web_url
);
});
});
});
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