Skip to content

Commit ed15731

Browse files
committed
Close notifications in unrelated tests
1 parent 31ec917 commit ed15731

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

tests/spec/features/assistance_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
require 'spec_helper'
22
require 'support/editor'
3+
require 'support/notifications'
34
require 'support/playground_actions'
45

56
RSpec.feature "Editor assistance for common code modifications", type: :feature, js: true do
67
include PlaygroundActions
78

8-
before { visit '/' }
9+
before do
10+
visit '/'
11+
Notifications.new(page).close_all
12+
end
913

1014
scenario "building code without a main method offers adding one" do
1115
editor.set <<~EOF
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Notifications
2+
attr_reader :page
3+
def initialize(page)
4+
@page = page
5+
end
6+
7+
def close_all
8+
page.all(:notification).each do |notification|
9+
page.within(notification) do
10+
page.click_on('dismiss notification')
11+
end
12+
end
13+
end
14+
end

0 commit comments

Comments
 (0)