-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: changes for data entry app [LIBS-684]
- Loading branch information
Showing
11 changed files
with
267 additions
and
14 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
13 changes: 10 additions & 3 deletions
13
src/period-calculation/generate-fixed-periods/does-period-end-before.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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import getValidLocale from './getValidLocale' | ||
|
||
describe('getValidLocale', () => { | ||
it('returns language only for a valid language', () => { | ||
const requestedLocale = 'pt' | ||
const outputLocale = 'pt' | ||
expect(getValidLocale(requestedLocale)).toEqual(outputLocale) | ||
}) | ||
|
||
it('returns language-region from java format', () => { | ||
const requestedLocale = 'pt_BR' | ||
const outputLocale = 'pt-BR' | ||
expect(getValidLocale(requestedLocale)).toEqual(outputLocale) | ||
}) | ||
|
||
it('returns language-region from valid ISO format', () => { | ||
const requestedLocale = 'pt-BR' | ||
const outputLocale = 'pt-BR' | ||
expect(getValidLocale(requestedLocale)).toEqual(outputLocale) | ||
}) | ||
|
||
it('returns language-script-region from DHIS2 format', () => { | ||
const requestedLocale = 'uz_UZ_Cyrl' | ||
const outputLocale = 'uz-Cyrl-UZ' | ||
expect(getValidLocale(requestedLocale)).toEqual(outputLocale) | ||
}) | ||
|
||
it('returns undefined for an invalid locale', () => { | ||
const requestedLocale = 'pb' | ||
const outputLocale = undefined | ||
expect(getValidLocale(requestedLocale)).toEqual(outputLocale) | ||
}) | ||
}) |
Oops, something went wrong.