Commit 7b242d2e authored by Eulyeon Ko's avatar Eulyeon Ko

Enable js for tests

parent ad5b16b6
...@@ -16,8 +16,6 @@ RSpec.describe "User sorts issues" do ...@@ -16,8 +16,6 @@ RSpec.describe "User sorts issues" do
let_it_be(:later_due_milestone) { create(:milestone, project: project, due_date: '2013-12-12') } let_it_be(:later_due_milestone) { create(:milestone, project: project, due_date: '2013-12-12') }
before do before do
stub_feature_flags(vue_issuables_list: false)
create_list(:award_emoji, 2, :upvote, awardable: issue1) create_list(:award_emoji, 2, :upvote, awardable: issue1)
create_list(:award_emoji, 2, :downvote, awardable: issue2) create_list(:award_emoji, 2, :downvote, awardable: issue2)
create(:award_emoji, :downvote, awardable: issue1) create(:award_emoji, :downvote, awardable: issue1)
...@@ -48,7 +46,7 @@ RSpec.describe "User sorts issues" do ...@@ -48,7 +46,7 @@ RSpec.describe "User sorts issues" do
expect(find('.issues-filters a.is-active')).to have_content('Milestone') expect(find('.issues-filters a.is-active')).to have_content('Milestone')
end end
it "sorts by popularity" do it "sorts by popularity", :js do
find('.filter-dropdown-container .dropdown').click find('.filter-dropdown-container .dropdown').click
page.within('ul.dropdown-menu.dropdown-menu-right li') do page.within('ul.dropdown-menu.dropdown-menu-right li') do
...@@ -70,14 +68,14 @@ RSpec.describe "User sorts issues" do ...@@ -70,14 +68,14 @@ RSpec.describe "User sorts issues" do
end end
end end
it 'sorts by newest' do it 'sorts by newest', :js do
visit project_issues_path(project, sort: sort_value_created_date) visit project_issues_path(project, sort: sort_value_created_date)
expect(first_issue).to include('foo') expect(first_issue).to include('foo')
expect(last_issue).to include('baz') expect(last_issue).to include('baz')
end end
it 'sorts by most recently updated' do it 'sorts by most recently updated', :js do
issue3.updated_at = Time.now + 100 issue3.updated_at = Time.now + 100
issue3.save issue3.save
visit project_issues_path(project, sort: sort_value_recently_updated) visit project_issues_path(project, sort: sort_value_recently_updated)
...@@ -85,7 +83,7 @@ RSpec.describe "User sorts issues" do ...@@ -85,7 +83,7 @@ RSpec.describe "User sorts issues" do
expect(first_issue).to include('baz') expect(first_issue).to include('baz')
end end
describe 'sorting by due date' do describe 'sorting by due date', :js do
before do before do
issue1.update(due_date: 1.day.from_now) issue1.update(due_date: 1.day.from_now)
issue2.update(due_date: 6.days.from_now) issue2.update(due_date: 6.days.from_now)
...@@ -122,7 +120,7 @@ RSpec.describe "User sorts issues" do ...@@ -122,7 +120,7 @@ RSpec.describe "User sorts issues" do
end end
end end
describe 'filtering by due date' do describe 'filtering by due date', :js do
before do before do
issue1.update(due_date: 1.day.from_now) issue1.update(due_date: 1.day.from_now)
issue2.update(due_date: 6.days.from_now) issue2.update(due_date: 6.days.from_now)
...@@ -205,7 +203,7 @@ RSpec.describe "User sorts issues" do ...@@ -205,7 +203,7 @@ RSpec.describe "User sorts issues" do
end end
end end
describe 'sorting by milestone' do describe 'sorting by milestone', :js do
before do before do
issue1.milestone = newer_due_milestone issue1.milestone = newer_due_milestone
issue1.save issue1.save
...@@ -221,7 +219,7 @@ RSpec.describe "User sorts issues" do ...@@ -221,7 +219,7 @@ RSpec.describe "User sorts issues" do
end end
end end
describe 'combine filter and sort' do describe 'combine filter and sort', :js do
let(:user2) { create(:user) } let(:user2) { create(:user) }
before do before 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