feat: allow hidden tags, either permanent or when there are no unread messages
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect, beforeEach } from 'vitest';
|
||||
import { useSettingsStore, DEFAULT_KEYWORDS, KEYWORD_PALETTE } from '../settings-store';
|
||||
import { useSettingsStore, DEFAULT_KEYWORDS, KEYWORD_PALETTE, getKeywordVisibility } from '../settings-store';
|
||||
import type { KeywordDefinition } from '../settings-store';
|
||||
|
||||
describe('settings-store keywords', () => {
|
||||
@@ -157,6 +157,17 @@ describe('settings-store keywords', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getKeywordVisibility', () => {
|
||||
it('treats a tag stored before visibility was configurable as always shown', () => {
|
||||
expect(getKeywordVisibility({ id: 'red', label: 'Red', color: 'red' })).toBe('show');
|
||||
});
|
||||
|
||||
it('returns the stored choice when there is one', () => {
|
||||
expect(getKeywordVisibility({ id: 'red', label: 'Red', color: 'red', visibility: 'unread' })).toBe('unread');
|
||||
expect(getKeywordVisibility({ id: 'red', label: 'Red', color: 'red', visibility: 'hide' })).toBe('hide');
|
||||
});
|
||||
});
|
||||
|
||||
describe('nestedTags', () => {
|
||||
it('is off by default', () => {
|
||||
useSettingsStore.getState().resetToDefaults();
|
||||
|
||||
Reference in New Issue
Block a user