@@ -24,11 +24,15 @@ const iconHref = (doc: Document): string =>
2424 doc . querySelector ( 'link[rel="icon"]' ) ?. getAttribute ( 'href' ) ?? '' ;
2525
2626test ( 'the title names the database and spells its state out' , ( ) => {
27- assert . equal ( tabTitle ( 'KeePass Web' , 'vault.kdbx' , true ) , '🔒 vault.kdbx - Locked - KeePass Web' ) ;
28- assert . equal (
29- tabTitle ( 'KeePass Web' , 'vault.kdbx' , false ) ,
30- '🔓 vault.kdbx - Unlocked - KeePass Web' ,
31- ) ;
27+ assert . equal ( tabTitle ( 'KeePass Web' , 'vault.kdbx' , true ) , 'vault.kdbx - Locked - KeePass Web' ) ;
28+ assert . equal ( tabTitle ( 'KeePass Web' , 'vault.kdbx' , false ) , 'vault.kdbx - Unlocked - KeePass Web' ) ;
29+ } ) ;
30+
31+ test ( 'the title never repeats the state as a padlock glyph' , ( ) => {
32+ for ( const locked of [ true , false ] ) {
33+ const title = tabTitle ( 'KeePass Web' , 'vault.kdbx' , locked ) ;
34+ assert . ok ( ! title . includes ( '\u{1F512}' ) && ! title . includes ( '\u{1F513}' ) , title ) ;
35+ }
3236} ) ;
3337
3438test ( 'no database means the page keeps its own name' , ( ) => {
@@ -41,12 +45,12 @@ test('the icon tracks the lock state and hands the page its own back', () => {
4145
4246 applyTabState ( doc , 'Base' , 'vault.kdbx' , true ) ;
4347 const locked = iconHref ( doc ) ;
44- assert . equal ( doc . title , '🔒 vault.kdbx - Locked - Base' ) ;
48+ assert . equal ( doc . title , 'vault.kdbx - Locked - Base' ) ;
4549 assert . notEqual ( locked , PAGE_ICON , 'a held database is not the page at rest' ) ;
4650
4751 applyTabState ( doc , 'Base' , 'vault.kdbx' , false ) ;
4852 const unlocked = iconHref ( doc ) ;
49- assert . equal ( doc . title , '🔓 vault.kdbx - Unlocked - Base' ) ;
53+ assert . equal ( doc . title , 'vault.kdbx - Unlocked - Base' ) ;
5054 assert . notEqual ( unlocked , locked , 'and the two states are not the same icon' ) ;
5155
5256 // Hue and glyph are what carry at 16px, so the two must differ in both.
@@ -72,6 +76,6 @@ test('a page whose icon link carries no href still gets one back', () => {
7276test ( 'a page with no icon link is titled anyway, not crashed' , ( ) => {
7377 const doc = pageDocument ( false ) ;
7478 applyTabState ( doc , 'Base' , 'vault.kdbx' , true ) ;
75- assert . equal ( doc . title , '🔒 vault.kdbx - Locked - Base' ) ;
79+ assert . equal ( doc . title , 'vault.kdbx - Locked - Base' ) ;
7680 assert . equal ( doc . querySelector ( 'link[rel="icon"]' ) , null ) ;
7781} ) ;
0 commit comments