Commit e069875e authored by Mike Greiling's avatar Mike Greiling

fix tests broken by new wiki page design

parent 952bdfae
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
$(this.sidebarEl).niceScroll(); $(this.sidebarEl).niceScroll();
const sidebarToggles = document.querySelectorAll('.js-sidebar-wiki-toggle'); const sidebarToggles = document.querySelectorAll('.js-sidebar-wiki-toggle');
for (const toggle of sidebarToggles) { for (let i = 0; i < sidebarToggles.length; i += 1) {
toggle.addEventListener('click', e => this.handleToggleSidebar(e)); sidebarToggles[i].addEventListener('click', e => this.handleToggleSidebar(e));
} }
this.newWikiForm = document.querySelector('form.new-wiki-page'); this.newWikiForm = document.querySelector('form.new-wiki-page');
......
...@@ -49,7 +49,6 @@ Feature: Project Wiki ...@@ -49,7 +49,6 @@ Feature: Project Wiki
Scenario: View all pages Scenario: View all pages
Given I have an existing wiki page Given I have an existing wiki page
And I browse to that Wiki page And I browse to that Wiki page
And I click on the "Pages" button
Then I should see the existing page in the pages list Then I should see the existing page in the pages list
Scenario: File exists in wiki repo Scenario: File exists in wiki repo
...@@ -72,13 +71,11 @@ Feature: Project Wiki ...@@ -72,13 +71,11 @@ Feature: Project Wiki
@javascript @javascript
Scenario: New Wiki page that has a path Scenario: New Wiki page that has a path
Given I create a New page with paths Given I create a New page with paths
And I click on the "Pages" button
Then I should see non-escaped link in the pages list Then I should see non-escaped link in the pages list
@javascript @javascript
Scenario: Edit Wiki page that has a path Scenario: Edit Wiki page that has a path
Given I create a New page with paths Given I create a New page with paths
And I click on the "Pages" button
And I edit the Wiki page with a path And I edit the Wiki page with a path
Then I should see a non-escaped path Then I should see a non-escaped path
And I should see the Editing page And I should see the Editing page
...@@ -88,7 +85,6 @@ Feature: Project Wiki ...@@ -88,7 +85,6 @@ Feature: Project Wiki
@javascript @javascript
Scenario: View the page history of a Wiki page that has a path Scenario: View the page history of a Wiki page that has a path
Given I create a New page with paths Given I create a New page with paths
And I click on the "Pages" button
And I view the page history of a Wiki page that has a path And I view the page history of a Wiki page that has a path
Then I should see a non-escaped path Then I should see a non-escaped path
And I should see the page history And I should see the page history
...@@ -96,7 +92,6 @@ Feature: Project Wiki ...@@ -96,7 +92,6 @@ Feature: Project Wiki
@javascript @javascript
Scenario: View an old page version of a Wiki page Scenario: View an old page version of a Wiki page
Given I create a New page with paths Given I create a New page with paths
And I click on the "Pages" button
And I edit the Wiki page with a path And I edit the Wiki page with a path
Then I should see a non-escaped path Then I should see a non-escaped path
And I should see the Editing page And I should see the Editing page
......
...@@ -241,7 +241,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -241,7 +241,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
page.within(:css, ".nav-text") do page.within(:css, ".nav-text") do
expect(page).to have_content "Test" expect(page).to have_content "Test"
expect(page).to have_content "Edit Page" expect(page).to have_content "Create Page"
end end
end end
...@@ -258,7 +258,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -258,7 +258,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "api") expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "api")
page.within(:css, ".nav-text") do page.within(:css, ".nav-text") do
expect(page).to have_content "Edit" expect(page).to have_content "Create"
expect(page).to have_content "Api" expect(page).to have_content "Api"
end end
end end
...@@ -271,7 +271,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -271,7 +271,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "raketasks") expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "raketasks")
page.within(:css, ".nav-text") do page.within(:css, ".nav-text") do
expect(page).to have_content "Edit" expect(page).to have_content "Create"
expect(page).to have_content "Rake" expect(page).to have_content "Rake"
end end
end end
......
...@@ -29,7 +29,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps ...@@ -29,7 +29,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
expect(page).to have_content "link test" expect(page).to have_content "link test"
click_link "link test" click_link "link test"
expect(page).to have_content "Edit Page" expect(page).to have_content "Create Page"
end end
step 'I have an existing Wiki page' do step 'I have an existing Wiki page' do
...@@ -80,13 +80,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps ...@@ -80,13 +80,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
expect(page).to have_content "Page was successfully deleted" expect(page).to have_content "Page was successfully deleted"
end end
step 'I click on the "Pages" button' do
click_on "Pages"
end
step 'I should see the existing page in the pages list' do step 'I should see the existing page in the pages list' do
expect(page).to have_content current_user.name expect(page).to have_content current_user.name
expect(page).to have_content @page.title expect(find('.wiki-pages')).to have_content @page.title.capitalize
end end
step 'I have an existing Wiki page with images linked on page' do step 'I have an existing Wiki page with images linked on page' do
...@@ -125,7 +121,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps ...@@ -125,7 +121,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
step 'I should see the new wiki page form' do step 'I should see the new wiki page form' do
expect(current_path).to match('wikis/image.jpg') expect(current_path).to match('wikis/image.jpg')
expect(page).to have_content('New Wiki Page') expect(page).to have_content('New Wiki Page')
expect(page).to have_content('Edit Page') expect(page).to have_content('Create Page')
end end
step 'I create a New page with paths' do step 'I create a New page with paths' do
...@@ -142,8 +138,8 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps ...@@ -142,8 +138,8 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end end
step 'I edit the Wiki page with a path' do step 'I edit the Wiki page with a path' do
expect(page).to have_content('three') expect(find('.wiki-pages')).to have_content('Three')
click_on 'three' click_on 'Three'
expect(find('.nav-text')).to have_content('Three') expect(find('.nav-text')).to have_content('Three')
click_on 'Edit' click_on 'Edit'
end end
...@@ -157,7 +153,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps ...@@ -157,7 +153,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end end
step 'I view the page history of a Wiki page that has a path' do step 'I view the page history of a Wiki page that has a path' do
click_on 'three' click_on 'Three'
click_on 'Page History' click_on 'Page History'
end end
......
...@@ -20,7 +20,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do ...@@ -20,7 +20,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
click_button 'Create page' click_button 'Create page'
expect(page).to have_content('Home') expect(page).to have_content('Home')
expect(page).to have_content("last edited by #{user.name}") expect(page).to have_content("Last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!') expect(page).to have_content('My awesome wiki!')
end end
end end
...@@ -41,7 +41,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do ...@@ -41,7 +41,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
click_button 'Create page' click_button 'Create page'
expect(page).to have_content('Foo') expect(page).to have_content('Foo')
expect(page).to have_content("last edited by #{user.name}") expect(page).to have_content("Last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!') expect(page).to have_content('My awesome wiki!')
end end
...@@ -55,7 +55,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do ...@@ -55,7 +55,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
click_button 'Create page' click_button 'Create page'
expect(page).to have_content('Spaces in the name') expect(page).to have_content('Spaces in the name')
expect(page).to have_content("last edited by #{user.name}") expect(page).to have_content("Last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!') expect(page).to have_content('My awesome wiki!')
end end
...@@ -69,7 +69,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do ...@@ -69,7 +69,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
click_button 'Create page' click_button 'Create page'
expect(page).to have_content('Hyphens in the name') expect(page).to have_content('Hyphens in the name')
expect(page).to have_content("last edited by #{user.name}") expect(page).to have_content("Last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!') expect(page).to have_content('My awesome wiki!')
end end
end end
...@@ -85,7 +85,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do ...@@ -85,7 +85,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
click_button 'Create page' click_button 'Create page'
expect(page).to have_content('Home') expect(page).to have_content('Home')
expect(page).to have_content("last edited by #{user.name}") expect(page).to have_content("Last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!') expect(page).to have_content('My awesome wiki!')
end end
end end
...@@ -105,7 +105,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do ...@@ -105,7 +105,7 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
click_button 'Create page' click_button 'Create page'
expect(page).to have_content('Foo') expect(page).to have_content('Foo')
expect(page).to have_content("last edited by #{user.name}") expect(page).to have_content("Last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!') expect(page).to have_content('My awesome wiki!')
end end
end end
......
...@@ -22,7 +22,7 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do ...@@ -22,7 +22,7 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
click_button 'Save changes' click_button 'Save changes'
expect(page).to have_content('Home') expect(page).to have_content('Home')
expect(page).to have_content("last edited by #{user.name}") expect(page).to have_content("Last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!') expect(page).to have_content('My awesome wiki!')
end end
end end
...@@ -37,7 +37,7 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do ...@@ -37,7 +37,7 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
click_button 'Save changes' click_button 'Save changes'
expect(page).to have_content('Home') expect(page).to have_content('Home')
expect(page).to have_content("last edited by #{user.name}") expect(page).to have_content("Last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!') expect(page).to have_content('My awesome wiki!')
end end
end end
......
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