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
e7f83ecf
Commit
e7f83ecf
authored
Feb 11, 2020
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky test due to lazy-loaded image
parent
ac6be496
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
spec/features/issues/issue_detail_spec.rb
spec/features/issues/issue_detail_spec.rb
+5
-3
No files found.
spec/features/issues/issue_detail_spec.rb
View file @
e7f83ecf
...
...
@@ -23,16 +23,18 @@ describe 'Issue Detail', :js do
context
'when issue description has xss snippet'
do
before
do
issue
.
update!
(
description:
'![xss" onload=alert(1);//](a)'
)
sign_in
(
user
)
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
end
it
'encodes the description to prevent xss issues'
do
page
.
within
(
'.issuable-details .detail-page-description'
)
do
image
=
find
(
'img.js-lazy-loaded'
)
expect
(
page
).
to
have_selector
(
'img'
,
count:
1
)
expect
(
find
(
'img'
)
[
'onerror'
]).
to
be_nil
expect
(
find
(
'img'
)
[
'src'
]).
to
end_with
(
'/a'
)
expect
(
image
[
'onerror'
]).
to
be_nil
expect
(
image
[
'src'
]).
to
end_with
(
'/a'
)
end
end
end
...
...
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