0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/spec/system/mobile_mode_spec.rb
David Taylor d2dc8d4f22
DEV: Drop empty core mobile/desktop stylesheets (#41988)
b1399d6a6f removed the last mobile/desktop-specific CSS from Discourse.
Everything is now handled by media queries in common scss.

This commit drops the mobile/desktop stylesheet infrastructure for core.
It remains in place for themes & plugins.

Much of the diff is updating specs to avoid mobile/desktop as fixtures,
and to remove argument defaults which no longer make sense.
2026-07-23 20:30:13 +01:00

41 lines
1.1 KiB
Ruby
Vendored

# frozen_string_literal: true
RSpec.describe "Viewport-based mobile mode" do
it "updates classes at runtime" do
visit "/"
expect(page).to have_css("html.desktop-view")
expect(page).not_to have_css("html.mobile-view")
resize_window(width: 400) do
expect(page).to have_css("html.mobile-view")
expect(page).not_to have_css("html.desktop-view")
end
end
context "when resizing viewport while on a topic page" do
fab!(:topic)
fab!(:post) { Fabricate(:post, topic:) }
it "handles navigation after resize from mobile to desktop" do
resize_window(width: 400) do
visit "/t/#{topic.slug}/#{topic.id}"
expect(page).to have_css("html.mobile-view")
end
click_logo
expect(page).to have_css(".topic-list")
end
it "handles navigation after resize from desktop to mobile" do
visit "/t/#{topic.slug}/#{topic.id}"
expect(page).to have_css("html.desktop-view")
resize_window(width: 400) do
expect(page).to have_css("html.mobile-view")
click_logo
expect(page).to have_css(".topic-list")
end
end
end
end