This commit is contained in:
@@ -32,6 +32,7 @@ def user_config():
|
||||
st.session_state.user_name = "Test User"
|
||||
st.session_state.user_email = "test@test.local"
|
||||
st.session_state.user_external_id = "111-2222-3333"
|
||||
st.session_state.current_theme = "light"
|
||||
|
||||
@pytest.fixture
|
||||
def app() -> AppTest:
|
||||
|
||||
@@ -1,15 +1,33 @@
|
||||
|
||||
import queries.crud as crud
|
||||
|
||||
def test_change_theme(app):
|
||||
app.run()
|
||||
app.switch_page("pages/settings.py").run()
|
||||
|
||||
assert app.session_state.current_theme =="light", "Light theme should be default"
|
||||
|
||||
assert app.button[0].label == "Light"
|
||||
assert app.button[0].disabled == True, "Light theme should be selected"
|
||||
|
||||
assert app.button[1].label == "Dark"
|
||||
assert app.button[1].disabled == False, "Dark theme should be de-selected"
|
||||
|
||||
app.button[1].click().run()
|
||||
|
||||
assert "dark" == crud.get_theme()
|
||||
|
||||
def test_change_color_palette(app):
|
||||
app.run()
|
||||
app.switch_page("pages/settings.py").run()
|
||||
|
||||
assert app.button[0].disabled == True
|
||||
assert app.button[0].label == "Flames **(selected)**"
|
||||
assert app.button[2].disabled == True, "First palette should be selected"
|
||||
assert app.button[2].label == "Flames **(selected)**"
|
||||
|
||||
app.button[1].click().run()
|
||||
app.button[3].click().run()
|
||||
|
||||
assert app.button[0].disabled == False
|
||||
assert app.button[0].label == "Flames"
|
||||
assert app.button[2].disabled == False, "First palette should be de-selected"
|
||||
assert app.button[2].label == "Flames"
|
||||
|
||||
assert app.button[1].disabled == True
|
||||
assert app.button[1].label == "Water **(selected)**"
|
||||
assert app.button[3].disabled == True, "Second palette should be selected"
|
||||
assert app.button[3].label == "Water **(selected)**"
|
||||
Reference in New Issue
Block a user