Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KonnorRogers committed Sep 29, 2024
1 parent 5a98a8e commit 54ccc21
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions tests/docs/specifying-accepted-file-types.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test("Should only allow PNG images to be added via file chooser", async ({ page
await page.goto(pagePath)

const fileChooserPromise = page.waitForEvent('filechooser');
await page.locator("rhino-editor[accept='image/*'] role-toolbar button[part~='toolbar__button--attach-files']").click()
await page.locator("rhino-editor[accept='image/*'] slot[name='toolbar'] button[part~='toolbar__button--attach-files']").click()
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles('./tests/fixtures/view-layer-benchmarks.png');

Expand All @@ -24,7 +24,7 @@ test("Should not allow non-png files to be added via file chooser", async ({ pag
await page.goto(pagePath)

const fileChooserPromise = page.waitForEvent('filechooser');
await page.locator("rhino-editor[accept='image/*'] role-toolbar button[part~='toolbar__button--attach-files']").click()
await page.locator("rhino-editor[accept='image/*'] slot[name='toolbar'] button[part~='toolbar__button--attach-files']").click()
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles('./tests/fixtures/thing.txt');
await expect(page.locator("rhino-editor#png-only figure")).not.toBeAttached()
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/attachment_attributes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def trix_png_figure

def attach_files(files)
rhino_editor = page.expect_file_chooser do
page.locator("rhino-editor role-toolbar [part~='toolbar__button--attach-files']").first.click
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--attach-files']").first.click
end
rhino_editor.set_files(files)

Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/attachment_galleries_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class AttachmentGalleriesTest < ApplicationSystemTestCase
def attach_files(files)
rhino_editor = page.expect_file_chooser do
page.locator("rhino-editor role-toolbar [part~='toolbar__button--attach-files']").first.click
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--attach-files']").first.click
end

files = files.map { |file| file_fixture(file).to_s }
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/blockquote_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
end

def block_quote_button(str = "")
page.locator("rhino-editor role-toolbar [part~='toolbar__button--blockquote']#{str}")
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--blockquote']#{str}")
end

test "Should have aria-pressed when pressed" do
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/bold_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
end

def bold_button(str = "")
page.locator("rhino-editor role-toolbar [part~='toolbar__button--bold']#{str}")
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--bold']#{str}")
end

test "Should have aria-pressed when pressed" do
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/bullet_list_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
end

def bullet_list_button(str = "")
page.locator("rhino-editor role-toolbar [part~='toolbar__button--bullet-list']#{str}")
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--bullet-list']#{str}")
end

test "Should have aria-pressed when pressed" do
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/code_block_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
end

def code_block_button(str = "")
page.locator("rhino-editor role-toolbar [part~='toolbar__button--code-block']#{str}")
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--code-block']#{str}")
end

test "Should have aria-pressed when pressed" do
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/heading_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
end

def heading_button(str = "")
page.locator("rhino-editor role-toolbar [part~='toolbar__button--heading']#{str}")
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--heading']#{str}")
end

test "Should have aria-pressed when pressed" do
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/italic_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
end

def italic_button(str = "")
page.locator("rhino-editor role-toolbar [part~='toolbar__button--italic']#{str}")
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--italic']#{str}")
end

test "Should have aria-pressed when pressed" do
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/link_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
end

def link_button(str = "")
page.locator("rhino-editor role-toolbar [part~='toolbar__button--link']#{str}")
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--link']#{str}")
end

test "Should have aria-pressed when pressed" do
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/ordered_list_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
end

def ordered_list_button(str = "")
page.locator("rhino-editor role-toolbar [part~='toolbar__button--ordered-list']#{str}")
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--ordered-list']#{str}")
end

test "Should have aria-pressed when pressed" do
Expand Down
2 changes: 1 addition & 1 deletion tests/rails/test/system/strike_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
end

def strike_button(str = "")
page.locator("rhino-editor role-toolbar [part~='toolbar__button--strike']#{str}")
page.locator("rhino-editor slot[name='toolbar'] [part~='toolbar__button--strike']#{str}")
end


Expand Down

0 comments on commit 54ccc21

Please sign in to comment.