discourse/spec/system/page_objects/modals/insert_table.rb
dependabot[bot] 91ef4f05c6
Build(deps): Bump jspreadsheet-ce from 4.15.0 to 5.0.4 (#32871)
Bumps [jspreadsheet-ce](https://github.com/jspreadsheet/ce) from 4.15.0
to 5.0.4.
- [Release notes](https://github.com/jspreadsheet/ce/releases)
- [Commits](https://github.com/jspreadsheet/ce/commits)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2026-01-14 18:28:15 +01:00

44 lines
1.1 KiB
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class InsertTable < PageObjects::Modals::Base
MODAL_SELECTOR = ".insert-table-modal"
SPREADSHEET_TABLE_SELECTOR = "#{MODAL_SELECTOR} .jss_worksheet"
def click_insert_table
find("#{MODAL_SELECTOR} .btn-insert-table").click
end
def cancel
click_button(I18n.t("js.cancel"))
end
def click_edit_reason
find("#{MODAL_SELECTOR} .btn-edit-reason").click
end
def type_edit_reason(text)
find("#{MODAL_SELECTOR} .edit-reason input").send_keys(text)
end
def find_cell(row, col)
find("#{SPREADSHEET_TABLE_SELECTOR} tbody tr[data-y='#{row}'] td[data-x='#{col}']")
end
def select_cell(row, col)
find_cell(row, col).double_click
end
def type_in_cell(row, col, text)
select_cell(row, col)
cell = find_cell(row, col).find("textarea")
cell.send_keys(text, :return)
end
def has_content_in_cell?(row, col, content)
find_cell(row, col).text == content
end
end
end
end