forked from binary-com/deriv-app
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[COJ]/likhith/KYC-1737/feat: incorporated changes to display occupati…
…on field (binary-com#14197) * feat: incorporated changes to display occupation field * fix: failing testcases * fix: incorporated review comments * fix: sync occupation values * fix: render issue in responsive mode * fix: occupation-field- sync issue * fix: removed comented code
- Loading branch information
1 parent
5bbb56a
commit ba2f6fd
Showing
9 changed files
with
110 additions
and
38 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
29 changes: 29 additions & 0 deletions
29
packages/account/src/Configs/__test__/financial-details-config.spec.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,29 @@ | ||
import { EMPLOYMENT_VALUES } from '@deriv/shared'; | ||
import { getFormattedOccupationList, getOccupationList } from '../financial-details-config'; | ||
|
||
describe('getFormattedOccupationList', () => { | ||
const occupation_list = getOccupationList(); | ||
|
||
it('should return all Occupations when Employment status is Unemployed', () => { | ||
const employment_status = EMPLOYMENT_VALUES.UNEMPLOYED; | ||
expect(getFormattedOccupationList(employment_status)).toHaveLength(occupation_list.length); | ||
}); | ||
|
||
it('should not return Unemployed as Occupations when Employment status is Self-Employed', () => { | ||
const employment_status = EMPLOYMENT_VALUES.SELF_EMPLOYED; | ||
const formatted_list = getFormattedOccupationList(employment_status); | ||
|
||
expect(formatted_list).toHaveLength(occupation_list.length - 1); | ||
|
||
expect(formatted_list).not.toContain(occupation_list.find(item => item.value === EMPLOYMENT_VALUES.UNEMPLOYED)); | ||
}); | ||
|
||
it('should not return Unemployed as Occupations when Employment status is Employed', () => { | ||
const employment_status = EMPLOYMENT_VALUES.EMPLOYED; | ||
const formatted_list = getFormattedOccupationList(employment_status); | ||
|
||
expect(formatted_list).toHaveLength(occupation_list.length - 1); | ||
|
||
expect(formatted_list).not.toContain(occupation_list.find(item => item.value === EMPLOYMENT_VALUES.UNEMPLOYED)); | ||
}); | ||
}); |
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