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
1f95d37d
Commit
1f95d37d
authored
Jul 21, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added repo_tab spec
parent
48881a31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
spec/javascripts/repo/repo_tab_spec.js
spec/javascripts/repo/repo_tab_spec.js
+70
-0
No files found.
spec/javascripts/repo/repo_tab_spec.js
0 → 100644
View file @
1f95d37d
import
Vue
from
'
vue
'
;
import
repoTab
from
'
~/repo/repo_tab.vue
'
;
describe
(
'
RepoTab
'
,
()
=>
{
const
RepoTab
=
Vue
.
extend
(
repoTab
);
function
createComponent
(
propsData
)
{
return
new
RepoTab
({
propsData
,
}).
$mount
();
}
it
(
'
renders a close link and a name link
'
,
()
=>
{
const
tab
=
{
loading
:
false
,
url
:
'
url
'
,
name
:
'
name
'
,
};
const
vm
=
createComponent
({
tab
,
});
const
close
=
vm
.
$el
.
querySelector
(
'
.close
'
);
const
name
=
vm
.
$el
.
querySelector
(
`a[title="
${
tab
.
url
}
"]`
)
spyOn
(
vm
,
'
xClicked
'
);
spyOn
(
vm
,
'
tabClicked
'
);
expect
(
close
).
toBeTruthy
();
expect
(
close
.
querySelector
(
'
.fa-times
'
)).
toBeTruthy
();
expect
(
name
).
toBeTruthy
();
expect
(
name
.
textContent
).
toEqual
(
tab
.
name
);
close
.
click
();
name
.
click
();
expect
(
vm
.
xClicked
).
toHaveBeenCalledWith
(
tab
);
expect
(
vm
.
tabClicked
).
toHaveBeenCalledWith
(
tab
);
});
it
(
'
renders a spinner if tab is loading
'
,
()
=>
{
const
tab
=
{
loading
:
true
,
url
:
'
url
'
,
};
const
vm
=
createComponent
({
tab
,
});
const
close
=
vm
.
$el
.
querySelector
(
'
.close
'
);
const
name
=
vm
.
$el
.
querySelector
(
`a[title="
${
tab
.
url
}
"]`
);
expect
(
close
).
toBeFalsy
();
expect
(
name
).
toBeFalsy
();
expect
(
vm
.
$el
.
querySelector
(
'
.fa.fa-spinner.fa-spin
'
)).
toBeTruthy
();
});
it
(
'
renders an fa-circle icon if tab is changed
'
,
()
=>
{
const
tab
=
{
loading
:
false
,
url
:
'
url
'
,
name
:
'
name
'
,
changed
:
true
,
};
const
vm
=
createComponent
({
tab
,
});
const
close
=
vm
.
$el
.
querySelector
(
'
.close
'
);
expect
(
close
.
querySelector
(
'
.fa-circle
'
)).
toBeTruthy
();
});
});
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