Commit 406e4da4 authored by Tom Quirk's avatar Tom Quirk Committed by Denys Mishunov

Add testid to wiki edit button

parent ce2991b8
......@@ -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)
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment