35 lines
1.2 KiB
Go
35 lines
1.2 KiB
Go
// Copyright (c) 2026 Storm Dragon
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package preferences
|
|
|
|
import (
|
|
"git.stormux.org/storm/fenrir/internal/config"
|
|
"git.stormux.org/storm/fenrir/internal/interaction"
|
|
"testing"
|
|
)
|
|
|
|
func TestApplicationSettingsOnlyExposeRestorableControls(t *testing.T) {
|
|
base := config.Defaults()
|
|
session, err := New_application_session(base, nil, "Ninjam application settings")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
values := session.Values()
|
|
for _, path := range []string{"presentation.speech.driver", "presentation.sound.theme", "keyboard.layout", "keyboard.devices", "reading.punctuation_profile", "clipboard.persistent"} {
|
|
if _, exists := values[path]; exists {
|
|
t.Fatal("startup/global control exposed", path)
|
|
}
|
|
}
|
|
if _, exists := values["presentation.speech.voice"]; !exists {
|
|
t.Fatal("voice control missing")
|
|
}
|
|
session.Handle(interaction.Key{Name: "tab"})
|
|
session.Handle(interaction.Key{Name: "tab"})
|
|
session.Handle(interaction.Key{Name: "up"})
|
|
saved, err := Application_settings(session, base)
|
|
if err != nil || saved.Presentation.Speech.Rate != base.Presentation.Speech.Rate+10 || saved.Keyboard.Layout != base.Keyboard.Layout {
|
|
t.Fatal(saved, err)
|
|
}
|
|
}
|