feat(grid): add column header tooltip toggle
This commit is contained in:
1 parent
3294ade2cc
commit
cd24f69daa
21 files changed
+173
-36
No files matched your search
+10
@@ -57,6 +57,16 @@ test("round-trips completion selection behavior through the editor settings draf
|
||||
assert.equal(editorSettingsDraftFromSettings({ ...DEFAULT_EDITOR_SETTINGS, ...patch }).selectFirstCompletionOnOpen, false);
|
||||
});
|
||||
|
||||
test("round-trips the column header hover tooltip toggle through the editor settings draft", () => {
|
||||
const base = editorSettingsDraftFromSettings(DEFAULT_EDITOR_SETTINGS);
|
||||
assert.equal(base.showColumnHeaderTooltips, true);
|
||||
|
||||
const patch = editorSettingsPatchFromDraft({ ...base, showColumnHeaderTooltips: false }, base);
|
||||
|
||||
assert.deepEqual(patch, { showColumnHeaderTooltips: false });
|
||||
assert.equal(editorSettingsDraftFromSettings({ ...DEFAULT_EDITOR_SETTINGS, ...patch }).showColumnHeaderTooltips, false);
|
||||
});
|
||||
|
||||
test("round-trips the persisted CSV quote mode through the editor settings draft", () => {
|
||||
const base = editorSettingsDraftFromSettings(DEFAULT_EDITOR_SETTINGS);
|
||||
const patch = editorSettingsPatchFromDraft({ ...base, csvQuoteMode: "necessary" }, base);
|
||||
|
||||
+29
@@ -629,6 +629,35 @@ test("keeps saved data grid header display settings", () => {
|
||||
assert.equal(settings.compactColumnHeaderActions, false);
|
||||
});
|
||||
|
||||
test("defaults column header hover tooltips to on", () => {
|
||||
// Existing installs have no persisted flag, so the grid must keep showing the
|
||||
// header tooltip until the user opts out.
|
||||
assert.equal(DEFAULT_EDITOR_SETTINGS.showColumnHeaderTooltips, true);
|
||||
assert.equal(normalizeEditorSettings({}).showColumnHeaderTooltips, true);
|
||||
assert.equal(normalizeEditorSettings({ showColumnHeaderTooltips: undefined } as any).showColumnHeaderTooltips, true);
|
||||
});
|
||||
|
||||
test("keeps a disabled column header hover tooltip preference", () => {
|
||||
assert.equal(normalizeEditorSettings({ showColumnHeaderTooltips: false } as any).showColumnHeaderTooltips, false);
|
||||
assert.equal(normalizeEditorSettings({ showColumnHeaderTooltips: true } as any).showColumnHeaderTooltips, true);
|
||||
});
|
||||
|
||||
test("updates the column header hover tooltip preference through the store", () => {
|
||||
setActivePinia(createPinia());
|
||||
const store = useSettingsStore();
|
||||
|
||||
assert.equal(store.editorSettings.showColumnHeaderTooltips, true);
|
||||
|
||||
store.updateEditorSettings({ showColumnHeaderTooltips: false });
|
||||
assert.equal(store.editorSettings.showColumnHeaderTooltips, false);
|
||||
|
||||
store.updateEditorSettings({ showColumnTypesInHeader: false });
|
||||
assert.equal(store.editorSettings.showColumnHeaderTooltips, false);
|
||||
|
||||
store.updateEditorSettings({ showColumnHeaderTooltips: true });
|
||||
assert.equal(store.editorSettings.showColumnHeaderTooltips, true);
|
||||
});
|
||||
|
||||
test("normalizes data grid render mode", () => {
|
||||
assert.equal(DEFAULT_EDITOR_SETTINGS.dataGridRenderMode, "canvas");
|
||||
assert.equal(normalizeEditorSettings({}).dataGridRenderMode, "canvas");
|
||||
|
||||
Reference in new issue
Block a user