Test theme color in web app manifest

This commit is contained in:
Karina Kwiatek 2022-07-12 16:07:36 +02:00 committed by Karina Kwiatek
parent e11b222368
commit 5e4819764a
1 changed files with 17 additions and 0 deletions

View File

@ -59,6 +59,23 @@ describe StaticController, type: :controller do
expect(body["name"]).to eq("Specspring")
expect(body["start_url"]).to eq("http://test.host/?source=pwa")
expect(body["scope"]).to eq("http://test.host/")
expect(body["theme_color"]).to eq("#5e35b1")
end
context "user with a theme is logged in" do
let(:user) { FactoryBot.create(:user) }
let!(:theme) { FactoryBot.create(:theme, user: user) }
before do
sign_in(user)
end
it "uses the user's theme" do
subject
expect(response).to have_http_status(200)
body = JSON.parse(response.body)
expect(body["theme_color"]).to eq("#8e8cd8")
end
end
end
end