forked from laurent22/joplin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Desktop: Made the same spellcheck languages more specific in the titl…
…e bar - Fixed the issue laurent22#7834 - added "spellCheckerMenu.test.ts" to test the changes and the expected behavior: all passed! - added jest.mock in "jest.setup.js" to mock the Menu from @electron/remote. - modified "buildScriptIndexes" to ignore ".test.ts" files so it does not include them in index.ts. That caused some issues with duplicate identifiers and more errors.
- Loading branch information
Showing
8 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/app-desktop/gui/MainScreen/commands/showSpellCheckerMenu.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { runtime } from './showSpellCheckerMenu'; | ||
import { AppState } from '../../../app.reducer'; | ||
|
||
describe('mapStateTotitle', () => { | ||
|
||
test('should return null if spellchecker.enabled is false', () => { | ||
|
||
const mockState: Partial<AppState> = { | ||
settings: { | ||
'spellChecker.enabled': false, | ||
'spellChecker.languages': ['en-GB'], | ||
}, | ||
}; | ||
const result = runtime().mapStateToTitle(mockState); | ||
expect(result).toBeNull(); | ||
}); | ||
|
||
test('should return null if spellChecker.languages is empty', () => { | ||
const mockState: Partial<AppState> = { | ||
settings: { | ||
'spellChecker.enabled': true, | ||
'spellChecker.languages': [], | ||
}, | ||
}; | ||
const result = runtime().mapStateToTitle(mockState); | ||
expect(result).toBeNull(); | ||
}); | ||
|
||
test('should return list of countryDisplayName with correct format', () => { | ||
const mockState: Partial<AppState> = { | ||
settings: { | ||
'spellChecker.enabled': true, | ||
'spellChecker.languages': ['en-GB', 'en-US', 'en-CA', 'es-ES', 'es-MX'], | ||
}, | ||
}; | ||
const result = runtime().mapStateToTitle(mockState); | ||
expect(result).toBe('en-GB, en-US, en-CA, es-ES, es-MX'); | ||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters