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
406e4da4
Commit
406e4da4
authored
Oct 15, 2020
by
Tom Quirk
Committed by
Denys Mishunov
Oct 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add testid to wiki edit button
parent
ce2991b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/views/shared/wikis/show.html.haml
app/views/shared/wikis/show.html.haml
+1
-1
spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb
...les/features/wiki/user_views_wiki_page_shared_examples.rb
+3
-3
No files found.
app/views/shared/wikis/show.html.haml
View file @
406e4da4
...
...
@@ -24,7 +24,7 @@
%h2
.gl-mt-0.gl-mb-5
{
data:
{
qa_selector:
'wiki_page_title'
,
testid:
'wiki_page_title'
}
}=
@page
.
human_title
%div
-
if
can?
(
current_user
,
:create_wiki
,
@wiki
.
container
)
&&
@page
.
latest?
&&
@valid_encoding
=
link_to
sprite_icon
(
'pencil'
,
css_class:
'gl-icon'
),
wiki_page_path
(
@wiki
,
@page
,
action: :edit
),
title:
'Edit'
,
role:
"button"
,
class:
'btn gl-button btn-icon
js-wiki-edit'
,
data:
{
qa_selector:
'edit_page
_button'
}
=
link_to
sprite_icon
(
'pencil'
,
css_class:
'gl-icon'
),
wiki_page_path
(
@wiki
,
@page
,
action: :edit
),
title:
'Edit'
,
role:
"button"
,
class:
'btn gl-button btn-icon
btn-default js-wiki-edit'
,
data:
{
qa_selector:
'edit_page_button'
,
testid:
'wiki_edit
_button'
}
.js-wiki-page-content.md.gl-pt-2
{
data:
{
qa_selector:
'wiki_page_content'
,
testid:
'wiki_page_content'
,
tracking_context:
wiki_page_tracking_context
(
@page
).
to_json
}
}
=
render_wiki_content
(
@page
)
...
...
spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb
View file @
406e4da4
...
...
@@ -121,7 +121,7 @@ RSpec.shared_examples 'User views a wiki page' do
it
'shows the page history'
do
visit
(
wiki_page_path
(
wiki
,
wiki_page
))
expect
(
page
).
to
have_selector
(
'
a.btn'
,
text:
'Edit
'
)
expect
(
page
).
to
have_selector
(
'
[data-testid="wiki_edit_button"]
'
)
click_on
(
'Page history'
)
...
...
@@ -133,7 +133,7 @@ RSpec.shared_examples 'User views a wiki page' do
it
'does not show the "Edit" button'
do
visit
(
wiki_page_path
(
wiki
,
wiki_page
,
version_id:
wiki_page
.
versions
.
last
.
id
))
expect
(
page
).
not_to
have_selector
(
'
a.btn'
,
text:
'Edit
'
)
expect
(
page
).
not_to
have_selector
(
'
[data-testid="wiki_edit_button"]
'
)
end
context
'show the diff'
do
...
...
@@ -250,7 +250,7 @@ RSpec.shared_examples 'User views a wiki page' do
end
it
'does not show "Edit" button'
do
expect
(
page
).
not_to
have_selector
(
'
a.btn'
,
text:
'Edit
'
)
expect
(
page
).
not_to
have_selector
(
'
[data-testid="wiki_edit_button"]
'
)
end
it
'shows error'
do
...
...
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