Files
python-tdd/src/functional_tests/test_applet_palette.py

30 lines
1.0 KiB
Python
Raw Normal View History

from selenium.webdriver.common.by import By
from apps.lyric.models import User
from .base import FunctionalTest
class SiteThemeTest(FunctionalTest):
def test_page_renders_with_earthman_palette(self):
self.browser.get(self.live_server_url)
body = self.browser.find_element(By.TAG_NAME, "body")
self.assertIn("palette-default", body.get_attribute("class"))
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")