feat: Update branding terminology and improve settings dialog for logo management
This commit is contained in:
parent
e52c09857f
commit
e1dbc2ee84
10 changed files with 104 additions and 57 deletions
|
|
@ -72,3 +72,28 @@ def test_config_from_env_uses_persisted_active_branding(tmp_path, monkeypatch):
|
|||
assert config.active_branding_id == "agravity"
|
||||
assert config.app_name == "Agravity Bridge"
|
||||
assert config.get_config_path().name == "config.json"
|
||||
|
||||
|
||||
def test_switching_back_to_default_restores_default_branding(tmp_path):
|
||||
"""Switching from a custom branding back to default should restore the default name."""
|
||||
manager = BrandingManager(base_dir=tmp_path)
|
||||
config = Config(
|
||||
app_name="WebDrop Bridge",
|
||||
app_version="1.0.0",
|
||||
log_level="INFO",
|
||||
log_file=None,
|
||||
allowed_roots=[],
|
||||
allowed_urls=[],
|
||||
webapp_url="http://localhost:8080",
|
||||
enable_logging=True,
|
||||
active_branding_id="agravity",
|
||||
)
|
||||
|
||||
manager.apply_to_config(config)
|
||||
assert config.app_name == "Agravity Bridge"
|
||||
|
||||
config.active_branding_id = "default"
|
||||
manager.apply_to_config(config)
|
||||
|
||||
assert config.app_name == "WebDrop Bridge"
|
||||
assert config.branding_display_name == "Default"
|
||||
|
|
|
|||
|
|
@ -120,7 +120,8 @@ class TestSettingsDialogInitialization:
|
|||
qtbot.addWidget(dialog)
|
||||
|
||||
assert dialog.branding_display_name_input.text() == "Default"
|
||||
assert dialog.branding_app_name_input.text() == "WebDrop Bridge"
|
||||
assert dialog.branding_logo_path_input is not None
|
||||
assert dialog.browse_branding_logo_btn is not None
|
||||
|
||||
def test_save_branding_as_creates_custom_template(
|
||||
self, qtbot, sample_config, monkeypatch, tmp_path
|
||||
|
|
@ -131,9 +132,9 @@ class TestSettingsDialogInitialization:
|
|||
qtbot.addWidget(dialog)
|
||||
|
||||
dialog.branding_display_name_input.setText("Customer A")
|
||||
dialog.branding_app_name_input.setText("Customer A Bridge")
|
||||
dialog.branding_logo_path_input.setText("/tmp/customer-logo.png")
|
||||
|
||||
with patch("PySide6.QtWidgets.QInputDialog.getText", return_value=("customer_a", True)):
|
||||
with patch("PySide6.QtWidgets.QInputDialog.getText", return_value=("Customer A", True)):
|
||||
dialog._save_branding_as()
|
||||
|
||||
assert dialog.branding_manager.has_template("customer_a")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue