2026-03-02 13:57:03 -05:00
|
|
|
from selenium.webdriver.common.by import By
|
|
|
|
|
|
2026-03-21 23:57:05 -04:00
|
|
|
from apps.lyric.models import User
|
|
|
|
|
|
2026-03-02 13:57:03 -05:00
|
|
|
from .base import FunctionalTest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SiteThemeTest(FunctionalTest):
|
2026-03-05 14:45:55 -05:00
|
|
|
def test_page_renders_with_earthman_palette(self):
|
2026-03-02 13:57:03 -05:00
|
|
|
self.browser.get(self.live_server_url)
|
|
|
|
|
body = self.browser.find_element(By.TAG_NAME, "body")
|
2026-03-05 14:45:55 -05:00
|
|
|
self.assertIn("palette-default", body.get_attribute("class"))
|
2026-03-21 23:57:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class LightPaletteTest(FunctionalTest):
|
|
|
|
|
def test_light_palette_tooltip_uses_white_background(self):
|
|
|
|
|
user, _ = User.objects.get_or_create(email="light@example.com")
|
|
|
|
|
user.palette = "palette-oblivion-light"
|
|
|
|
|
user.save()
|
|
|
|
|
self.create_pre_authenticated_session("light@example.com")
|
|
|
|
|
|
|
|
|
|
self.browser.get(self.live_server_url + "/dashboard/wallet/")
|
|
|
|
|
|
|
|
|
|
body = self.browser.find_element(By.TAG_NAME, "body")
|
|
|
|
|
tooltip_bg = self.browser.execute_script(
|
|
|
|
|
"return getComputedStyle(arguments[0]).getPropertyValue('--tooltip-bg').trim()",
|
|
|
|
|
body,
|
|
|
|
|
)
|
|
|
|
|
self.assertEqual(tooltip_bg, "255, 255, 255")
|