Skip to content

Commit

Permalink
Add an empty widget so that the tests are not confused
Browse files Browse the repository at this point in the history
The previous defaults were not applied, causing the my page to be empty.
It now has a default, but we want to restore the previously tested rows
and columns
  • Loading branch information
oliverguenther committed Oct 7, 2024
1 parent efbabdb commit 0d6c48a
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/my_page/spec/factories/grid_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@
)
]
end

trait :empty do
widgets { [] }
row_count { 1 }
column_count { 1 }
end
end
end
5 changes: 5 additions & 0 deletions modules/my_page/spec/features/my/custom_text_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
let(:other_user) do
create(:user, member_with_permissions: { project => permissions })
end

let!(:my_page_grid) do
create(:my_page, :empty, user:)
end

let(:my_page) do
Pages::My::Page.new
end
Expand Down
4 changes: 4 additions & 0 deletions modules/my_page/spec/features/my/documents_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
Pages::My::Page.new
end

let!(:my_page_grid) do
create(:my_page, :empty, user:)
end

before do
login_as user

Expand Down
4 changes: 4 additions & 0 deletions modules/my_page/spec/features/my/my_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
Pages::My::Page.new
end

let!(:my_page_grid) do
create(:my_page, :empty, user:)
end

before do
login_as user

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
let!(:week_days) { week_with_saturday_and_sunday_as_weekend }
let!(:non_working_day) { create(:non_working_day, date: tuesday) }

let!(:my_page_grid) do
create(:my_page, :empty, user:)
end

before do
login_as user
my_page.visit!
Expand Down
4 changes: 4 additions & 0 deletions modules/my_page/spec/features/my/news_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
Pages::My::Page.new
end

let!(:my_page_grid) do
create(:my_page, :empty, user:)
end

before do
login_as user

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@
create(:user,
member_with_permissions: { project => %i[view_time_entries edit_time_entries view_work_packages log_own_time] })
end

let!(:my_page_grid) do
create(:my_page, :empty, user:)
end

let(:my_page) do
Pages::My::Page.new
end
Expand Down
4 changes: 4 additions & 0 deletions modules/my_page/spec/features/my/work_package_table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
Pages::My::Page.new
end

let!(:my_page_grid) do
create(:my_page, :empty, user:)
end

let(:modal) { Components::WorkPackages::TableConfigurationModal.new }
let(:filters) { Components::WorkPackages::TableConfiguration::Filters.new }
let(:columns) { Components::WorkPackages::Columns.new }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
Pages::My::Page.new
end

let!(:my_page_grid) do
create(:my_page, :empty, user:)
end

before do
login_as user
work_package.add_watcher(user)
Expand Down

0 comments on commit 0d6c48a

Please sign in to comment.