33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
|
|
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[2].disabled == True, "First palette should be selected"
|
|
assert app.button[2].label == "Flames **(selected)**"
|
|
|
|
app.button[3].click().run()
|
|
|
|
assert app.button[2].disabled == False, "First palette should be de-selected"
|
|
assert app.button[2].label == "Flames"
|
|
|
|
assert app.button[3].disabled == True, "Second palette should be selected"
|
|
assert app.button[3].label == "Water **(selected)**" |