1 parent
31a7609604
commit
18d581137c
10 files changed
+157
-3
No files matched your search
+23
@@ -99,6 +99,29 @@ test("numericColumnRightAlign defaults to true and round-trips through normalize
|
||||
assert.equal(normalizeEditorSettings({ numericColumnRightAlign: "false" as unknown as boolean }).numericColumnRightAlign, true);
|
||||
});
|
||||
|
||||
test("completion column sorting defaults to alphabetical and normalizes saved booleans", () => {
|
||||
assert.equal(DEFAULT_EDITOR_SETTINGS.sortCompletionColumnsAlphabetically, true);
|
||||
assert.equal(normalizeEditorSettings({}).sortCompletionColumnsAlphabetically, true);
|
||||
assert.equal(normalizeEditorSettings({ sortCompletionColumnsAlphabetically: false }).sortCompletionColumnsAlphabetically, false);
|
||||
assert.equal(normalizeEditorSettings({ sortCompletionColumnsAlphabetically: true }).sortCompletionColumnsAlphabetically, true);
|
||||
assert.equal(normalizeEditorSettings({ sortCompletionColumnsAlphabetically: "false" as unknown as boolean }).sortCompletionColumnsAlphabetically, true);
|
||||
});
|
||||
|
||||
test("updateEditorSettings persists completion column sort toggles", async () => {
|
||||
await withMockLocalStorage({}, async () => {
|
||||
setActivePinia(createPinia());
|
||||
const store = useSettingsStore();
|
||||
await store.initEditorSettings();
|
||||
|
||||
store.updateEditorSettings({ sortCompletionColumnsAlphabetically: false });
|
||||
assert.equal(store.editorSettings.sortCompletionColumnsAlphabetically, false);
|
||||
await vi.waitFor(() => {
|
||||
const saved = saveEditorSettingsMock.mock.calls.at(-1)?.[0] as { sortCompletionColumnsAlphabetically?: boolean } | undefined;
|
||||
assert.equal(saved?.sortCompletionColumnsAlphabetically, false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test("updateEditorSettings persists numericColumnRightAlign toggles", async () => {
|
||||
await withMockLocalStorage({}, async () => {
|
||||
setActivePinia(createPinia());
|
||||
|
||||
Reference in new issue
Block a user