discourse/spec/system/capabilities_service_spec.rb
Jarek Radosz c29c566dc2
DEV: Make visit() wait for the app to boot (#39659)
And the same for `page.refresh()`
2026-04-30 17:33:57 +02:00

21 lines
497 B
Ruby

# frozen_string_literal: true
describe "capabilities service" do
describe "viewport helpers" do
it "works" do
def matches(name)
page.evaluate_script("Discourse.lookup('service:capabilities').viewport[#{name.to_json}]")
end
visit "/"
expect(matches("sm")).to eq(true)
expect(matches("lg")).to eq(true)
resize_window(width: 700) do
expect(matches("sm")).to eq(true)
expect(matches("lg")).to eq(false)
end
end
end
end