-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update feature_branch with master (#9220)
* fix: close account message doesn't show up (#9210) Co-authored-by: niloofar sadeghi <niloofar.sadeghi@re-work.dev> * Jim/WEBREL-667/fix-bug-revealed-during-ts-migration (#9216) * revert: revert code changes * fix: fix bug revealed during ts migration * chore: add test cases for line changed --------- Co-authored-by: Niloofar Sadeghi <93518187+niloofar-deriv@users.noreply.github.com> Co-authored-by: niloofar sadeghi <niloofar.sadeghi@re-work.dev> Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com>
- Loading branch information
1 parent
cb17414
commit 7205738
Showing
3 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
packages/account/src/Configs/__test__/address-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,35 @@ | ||
import { TSchema, regex_checks } from '@deriv/shared'; | ||
import { transformConfig } from 'Configs/address-details-config'; | ||
|
||
describe('address-details-config', () => { | ||
let address_details_config: TSchema; | ||
beforeEach(() => { | ||
const account_settings = { | ||
address_state: 'test', | ||
}; | ||
address_details_config = { | ||
address_state: { | ||
supported_in: ['svg', 'iom', 'malta', 'maltainvest'], | ||
default_value: account_settings.address_state, | ||
rules: [ | ||
['req', 'State is required'], | ||
[ | ||
'regular', | ||
'State is not in a proper format', | ||
{ | ||
regex: regex_checks.address_details.address_state, | ||
}, | ||
], | ||
], | ||
}, | ||
}; | ||
}); | ||
it('should remove the required rule for non-eu clients', () => { | ||
const transformed_config = transformConfig(address_details_config, 'svg'); | ||
expect(transformed_config.address_state.rules).not.toContainEqual(['req', 'State is required']); | ||
}); | ||
it('should remove the required rule for eu clients', () => { | ||
const transformed_config = transformConfig(address_details_config, 'maltainvest'); | ||
expect(transformed_config.address_state.rules).not.toContainEqual(['req', 'State is required']); | ||
}); | ||
}); |
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