Preferences tab added for the internal UI.
This commit is contained in:
1 parent
cf95b17e5d
commit
6fc3416a1b
27 files changed
+858
-434
No files matched your search
@@ -38,7 +38,7 @@ func TestSettingsFormCoversSchemaAndReturnsIsolatedDraft(t *testing.T) {
|
||||
t.Fatal(got)
|
||||
}
|
||||
values := session.Values()
|
||||
if len(values) != 51 {
|
||||
if len(values) != 55 {
|
||||
t.Fatal("missing settings or buttons", len(values))
|
||||
}
|
||||
unchanged, err := Settings(session, base)
|
||||
@@ -288,3 +288,36 @@ func TestSoundChoicesPreserveUnavailableThemeAndFileOnlyDevice(t *testing.T) {
|
||||
t.Fatal(draft.Presentation.Sound, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInternalUIOptionsAndApplicationIsolation(t *testing.T) {
|
||||
base := config.Defaults()
|
||||
session, err := New_session(base, []string{"internal_ui"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if session.Describe() != "Internal UI tab" {
|
||||
t.Fatal(session.Describe())
|
||||
}
|
||||
for _, label := range []string{"Announce grid row and column", "Announce item position"} {
|
||||
if got := session.Handle(interaction.Key{Name: "tab"}).Speech; got != label+" checked" {
|
||||
t.Fatal(got)
|
||||
}
|
||||
session.Handle(interaction.Key{Name: "space"})
|
||||
draft, err := Settings(session, base)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if draft.InternalUI.AnnounceGridCoordinates || draft.InternalUI.AnnounceItemPosition != (label == "Announce grid row and column") {
|
||||
t.Fatal("options did not save independently", draft.InternalUI)
|
||||
}
|
||||
}
|
||||
application, err := New_application_session(base, nil, "Application settings")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for path := range application.Values() {
|
||||
if strings.HasPrefix(path, "internal_ui.") {
|
||||
t.Fatal("global preference in application form", path)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user