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
b3b24458
Commit
b3b24458
authored
Aug 07, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ci skip] Add repo_edit_button_spec and repo_preview_spec
parent
8ae20ecb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
1 deletion
+74
-1
spec/javascripts/repo/components/repo_edit_button_spec.js
spec/javascripts/repo/components/repo_edit_button_spec.js
+50
-0
spec/javascripts/repo/components/repo_preview_spec.js
spec/javascripts/repo/components/repo_preview_spec.js
+23
-0
spec/javascripts/repo/components/repo_sidebar_spec.js
spec/javascripts/repo/components/repo_sidebar_spec.js
+1
-1
No files found.
spec/javascripts/repo/components/repo_edit_button_spec.js
0 → 100644
View file @
b3b24458
import
Vue
from
'
vue
'
;
import
repoEditButton
from
'
~/repo/components/repo_edit_button.vue
'
;
import
RepoStore
from
'
~/repo/stores/repo_store
'
;
describe
(
'
RepoEditButton
'
,
()
=>
{
function
createComponent
()
{
const
RepoEditButton
=
Vue
.
extend
(
repoEditButton
);
return
new
RepoEditButton
().
$mount
();
}
it
(
'
renders an edit button that toggles the view state
'
,
(
done
)
=>
{
RepoStore
.
isCommitable
=
true
;
const
vm
=
createComponent
();
expect
(
vm
.
$el
.
tagName
).
toEqual
(
'
BUTTON
'
);
expect
(
vm
.
$el
.
textContent
).
toMatch
(
'
Edit
'
);
spyOn
(
vm
,
'
editClicked
'
).
and
.
callThrough
();
vm
.
$el
.
click
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
editClicked
).
toHaveBeenCalled
();
expect
(
vm
.
$el
.
textContent
).
toMatch
(
'
Cancel edit
'
);
done
();
});
});
it
(
'
does not render if not isCommitable
'
,
()
=>
{
RepoStore
.
isCommitable
=
false
;
const
vm
=
createComponent
();
expect
(
vm
.
$el
.
innerHTML
).
toBeUndefined
();
});
describe
(
'
methods
'
,
()
=>
{
describe
(
'
editClicked
'
,
()
=>
{
it
(
'
sets dialog to open when there are changedFiles
'
,
()
=>
{
});
it
(
'
toggles editMode and calls toggleBlobView
'
,
()
=>
{
});
});
});
});
spec/javascripts/repo/components/repo_preview_spec.js
0 → 100644
View file @
b3b24458
import
Vue
from
'
vue
'
;
import
repoPreview
from
'
~/repo/components/repo_preview.vue
'
;
import
RepoStore
from
'
~/repo/stores/repo_store
'
;
describe
(
'
RepoPreview
'
,
()
=>
{
function
createComponent
()
{
const
RepoPreview
=
Vue
.
extend
(
repoPreview
);
return
new
RepoPreview
().
$mount
();
}
it
(
'
renders a div with the activeFile html
'
,
()
=>
{
const
activeFile
=
{
html
:
'
<p class="file-content">html</p>
'
,
};
RepoStore
.
activeFile
=
activeFile
;
const
vm
=
createComponent
();
expect
(
vm
.
$el
.
tagName
).
toEqual
(
'
DIV
'
);
expect
(
vm
.
$el
.
innerHTML
).
toEqual
(
activeFile
.
html
);
});
});
spec/javascripts/repo/components/repo_sidebar_spec.js
View file @
b3b24458
...
...
@@ -2,7 +2,7 @@ import Vue from 'vue';
import
RepoStore
from
'
~/repo/stores/repo_store
'
;
import
repoSidebar
from
'
~/repo/components/repo_sidebar.vue
'
;
describe
(
'
RepoSidebar
'
,
()
=>
{
f
describe
(
'
RepoSidebar
'
,
()
=>
{
function
createComponent
()
{
const
RepoSidebar
=
Vue
.
extend
(
repoSidebar
);
...
...
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