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
Léo-Paul Géneau
gitlab-ce
Commits
b4e2f9f1
Commit
b4e2f9f1
authored
Apr 25, 2017
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test async nature of issue show
parent
3417e97c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
16 deletions
+41
-16
app/assets/javascripts/issue_show/issue_title_description.vue
...assets/javascripts/issue_show/issue_title_description.vue
+1
-1
spec/features/task_lists_spec.rb
spec/features/task_lists_spec.rb
+1
-8
spec/javascripts/issue_show/issue_title_description_spec.js
spec/javascripts/issue_show/issue_title_description_spec.js
+34
-7
spec/javascripts/issue_show/mock_data.js
spec/javascripts/issue_show/mock_data.js
+5
-0
No files found.
app/assets/javascripts/issue_show/issue_title_description.vue
View file @
b4e2f9f1
...
...
@@ -20,7 +20,7 @@ export default {
errorCallback
:
(
err
)
=>
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
// eslint-disable-next-line no-console
console
.
error
(
'
ISSUE SHOW
TITLE
REALTIME ERROR
'
,
err
);
console
.
error
(
'
ISSUE SHOW REALTIME ERROR
'
,
err
);
}
else
{
throw
new
Error
(
err
);
}
...
...
spec/features/task_lists_spec.rb
View file @
b4e2f9f1
...
...
@@ -70,7 +70,6 @@ feature 'Task Lists', feature: true do
it
'renders'
do
visit_issue
(
project
,
issue
)
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'ul.task-list'
,
count:
1
)
...
...
@@ -80,11 +79,10 @@ feature 'Task Lists', feature: true do
it
'contains the required selectors'
do
visit_issue
(
project
,
issue
)
wait_for_vue_resource
container
=
'.detail-page-description .description.js-task-list-container'
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
container
)
expect
(
page
).
to
have_selector
(
"
#{
container
}
.wiki .task-list .task-list-item .task-list-item-checkbox"
)
expect
(
page
).
to
have_selector
(
"
#{
container
}
.js-task-list-field"
)
...
...
@@ -94,16 +92,13 @@ feature 'Task Lists', feature: true do
it
'is only editable by author'
do
visit_issue
(
project
,
issue
)
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.js-task-list-container'
)
logout
(
:user
)
login_as
(
user2
)
visit
current_path
wait_for_vue_resource
expect
(
page
).
not_to
have_selector
(
'.js-task-list-container'
)
end
...
...
@@ -119,7 +114,6 @@ feature 'Task Lists', feature: true do
it
'renders'
do
visit_issue
(
project
,
issue
)
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'ul.task-list'
,
count:
1
)
...
...
@@ -138,7 +132,6 @@ feature 'Task Lists', feature: true do
it
'renders'
do
visit_issue
(
project
,
issue
)
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'ul.task-list'
,
count:
1
)
...
...
spec/javascripts/issue_show/issue_title_description_spec.js
View file @
b4e2f9f1
import
Vue
from
'
vue
'
;
import
$
from
'
jquery
'
;
import
'
~/render_math
'
;
import
'
~/render_gfm
'
;
import
issueTitle
from
'
~/issue_show/issue_title_description.vue
'
;
import
issueShowData
from
'
./mock_data
'
;
window
.
$
=
$
;
const
issueShowInterceptor
=
(
request
,
next
)
=>
{
console
.
log
(
issueShowData
);
next
(
request
.
respondWith
(
JSON
.
stringify
(
issueShowData
),
{
status
:
200
,
}));
};
describe
(
'
Issue Title
'
,
()
=>
{
let
IssueTitleComponent
;
const
comps
=
{
IssueTitleComponent
:
{},
};
beforeEach
(()
=>
{
IssueTitleComponent
=
Vue
.
extend
(
issueTitle
);
comps
.
IssueTitleComponent
=
Vue
.
extend
(
issueTitle
);
Vue
.
http
.
interceptors
.
push
(
issueShowInterceptor
);
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
issueShowInterceptor
,
);
});
it
(
'
should render a title
'
,
()
=>
{
const
component
=
new
IssueTitleComponent
({
it
(
'
should render a title
'
,
(
done
)
=>
{
const
issueShowComponent
=
new
comps
.
IssueTitleComponent
({
propsData
:
{
initialTitle
:
'
wow
'
,
candescription
:
'
.css-stuff
'
,
endpoint
:
'
/gitlab-org/gitlab-shell/issues/9/rendered_title
'
,
},
}).
$mount
();
expect
(
component
.
$el
.
classList
).
toContain
(
'
title
'
);
expect
(
component
.
$el
.
innerHTML
).
toContain
(
'
wow
'
);
// need setTimeout because actual setTimeout in code :P
setTimeout
(()
=>
{
expect
(
issueShowComponent
.
$el
.
querySelector
(
'
.title
'
).
innerHTML
)
.
toContain
(
'
this is a title
'
);
done
();
},
300
);
// 300 is just three times the Vue comps setTimeout to ensure pass
});
});
spec/javascripts/issue_show/mock_data.js
0 → 100644
View file @
b4e2f9f1
export
default
{
title
:
'
<p>this is a title</p>
'
,
description
:
'
<p>this is a description!</p>
'
,
description_text
:
'
this is a description
'
,
};
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