2022-12-09 18:28:17 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "rails_helper"
|
|
|
|
|
2024-08-06 13:50:32 -07:00
|
|
|
describe UseCase::DataExport::Theme,
|
|
|
|
:data_export do
|
2022-12-09 18:28:17 -08:00
|
|
|
include ActiveSupport::Testing::TimeHelpers
|
|
|
|
|
|
|
|
context "when user doesn't have a theme" do
|
|
|
|
it "returns nothing" do
|
|
|
|
expect(subject).to eq({})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "when user has a theme" do
|
|
|
|
let!(:theme) do
|
2024-08-06 13:50:32 -07:00
|
|
|
travel_to(Time.utc(2022,
|
|
|
|
12,
|
|
|
|
10,
|
|
|
|
13,
|
|
|
|
37,
|
|
|
|
42,)) do
|
|
|
|
FactoryBot.create(:theme,
|
|
|
|
user:,)
|
2022-12-09 18:28:17 -08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it "returns the theme as json" do
|
|
|
|
expect(json_file("theme.json")).to eq(
|
|
|
|
{
|
|
|
|
theme: {
|
2024-08-06 13:50:32 -07:00
|
|
|
background_color: "#c6c5eb",
|
|
|
|
body_text: "#333333",
|
|
|
|
danger_color: "#d98b8b",
|
2024-08-06 13:44:07 -07:00
|
|
|
danger_text: "#ffffff",
|
2024-08-06 13:50:32 -07:00
|
|
|
dark_color: "#666666",
|
2024-08-06 13:44:07 -07:00
|
|
|
dark_text: "#eeeeee",
|
2024-08-06 13:50:32 -07:00
|
|
|
info_color: "#8bd9d9",
|
2024-08-06 13:44:07 -07:00
|
|
|
info_text: "#ffffff",
|
|
|
|
input_color: "#f0edf4",
|
|
|
|
input_placeholder: "#6c757d",
|
2024-08-06 13:50:32 -07:00
|
|
|
input_text: "#666666",
|
2024-08-06 13:44:07 -07:00
|
|
|
light_color: "#f8f9fa",
|
|
|
|
light_text: "#000000",
|
2024-08-06 13:50:32 -07:00
|
|
|
muted_text: "#333333",
|
|
|
|
primary_color: "#8e8cd8",
|
2024-08-06 13:44:07 -07:00
|
|
|
primary_text: "#ffffff",
|
|
|
|
raised_accent: "#f7f7f7",
|
2024-08-06 13:50:32 -07:00
|
|
|
raised_accent_text: "#333333",
|
2024-08-06 13:44:07 -07:00
|
|
|
raised_background: "#ffffff",
|
2024-08-06 13:50:32 -07:00
|
|
|
raised_text: "#333333",
|
|
|
|
success_color: "#bfd98b",
|
2024-08-06 13:44:07 -07:00
|
|
|
success_text: "#ffffff",
|
2024-08-06 13:50:32 -07:00
|
|
|
warning_color: "#d99e8b",
|
|
|
|
warning_text: "#ffffff",
|
2024-08-06 13:44:07 -07:00
|
|
|
},
|
|
|
|
},
|
2022-12-09 18:28:17 -08:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|