-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enh(DocVerification): support global document verification (#57)
* refactor: remove development environment * redesign: use `valid_documents` for global doc v * tests: fix flaxy tests by loading fixtures early * assets: change the chevron-down icon, add chevron-up * enh: add `Combobox` component for autocomplete, custom dropdown * enh: use `Combobox in document verification * tests: rewrite tests for a combobox world * temp: use preview build of updated smart-camera-web for global doc v * enh(Combobox): add button next to input for text - add focus / blur events to input - add button for control of listbox * enh: handle single country case * tests: select id type using direct descendant selector * enh(Combobox): add `value` and `disabled` attributes * redesign(Combobox): remove focus / blur listeners on input, fix spaces * redesign: fix preselection state for document verification * tests: load id options in before each hooks * tests: fix test names for verification-method-selection * enh: change back / close buttons * styles: add hover styles for combobox-option * refactor: remove search icon from Combobox * styles(combobox): listbox inline-size should match trigger, add .5rem offset * fix: reload id types on country change * refactor: use function and not arrow function * refactor: close combobox on external click or focus event * tests: fix failing test * version: bump version number for global docv * redesign: support legacy id types * fix: fix lint errors * refactor: rename eslintrc as cjs * fix: reference minified file * refactor: reinstate global doc v changes * tests: fix broken test * tmp: use unminified versions for debugging * Revert "tmp: use unminified versions for debugging" This reverts commit ebf0afe. * enh: allow "Others" in id_selection * format: use spaces and not tabs * enh: make "others" check in id_selection case insensitive * fix: fix lint error * fix: fix "others" case insensitive bug * version: bump version for global doc v
- Loading branch information
1 parent
7983521
commit b9b077e
Showing
26 changed files
with
17,354 additions
and
351 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,49 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<style> | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
max-width: 100%; | ||
min-height: 100%; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<script src="js/script.min.js"></script> | ||
|
||
<script> | ||
SmileIdentity({ | ||
token: | ||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX3BhcmFtcyI6eyJ1c2VyX2lkIjoidXNlci1mZTIwY2JkYS1jMjJiLTRmZmUtOWRlZC05YjZhZGI2MDE1ZmIiLCJqb2JfaWQiOiJqb2ItNjYzY2VhNTUtZWIxYy00MjI2LWI1N2YtOGEwMTAwOTc4ZjViIiwiam9iX3R5cGUiOjF9LCJjYWxsYmFja191cmwiOiJodHRwczovL3dlYmhvb2suc2l0ZS9iZTM0YzkzZC1hOTFmLTQzZGItYWVmMi05MDZjNWNkOTVkNDciLCJpYXQiOjE2MzQyODE0MTAsImV4cCI6MTYzNTkxNTY4NH0.B4JaP4UWbNs38hV9nQ_9_Pnpos0fM3qu2nGG7Eymjs8", | ||
product: "doc_verification", | ||
callback_url: | ||
"https://portal.smileidentity.com/api/v2/007/postback/update_status", | ||
environment: "sandbox", | ||
id_selection: { | ||
NG: ["DRIVERS_LICENSE", "VOTER_ID", "PASSPORT"], | ||
ZA: ["NATIONAL_ID", "GREEN_BOOK", "Others"], | ||
GH: ["SSNIT"], | ||
}, | ||
partner_details: { | ||
name: "Test Org", | ||
logo_url: "https://portal.smileidentity.com/favicon.ico", | ||
partner_id: "007", | ||
policy_url: "https://smileidentity.com/privacy-policy", | ||
theme_color: "#000", | ||
}, | ||
onSuccess: () => {}, | ||
onClose: () => {}, | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,47 +1,59 @@ | ||
it("should show consent screen for the required id type", () => { | ||
cy.visit("/consent-required"); | ||
describe("consent required", () => { | ||
beforeEach(() => { | ||
cy.loadIDOptions(); | ||
}); | ||
|
||
cy.selectBVNIDType(); | ||
it("should show consent screen for the required id type", () => { | ||
cy.visit("/consent-required"); | ||
|
||
cy.getIFrameBody() | ||
.find("end-user-consent") | ||
.shadow() | ||
.find("#consent-screen") | ||
.should("be.visible"); | ||
}); | ||
cy.selectBVNIDType(); | ||
|
||
it("should NOT show consent screen for the non-required id type", () => { | ||
cy.visit("/consent-required"); | ||
cy.getIFrameBody() | ||
.find("end-user-consent") | ||
.shadow() | ||
.find("#consent-screen") | ||
.should("be.visible"); | ||
}); | ||
|
||
cy.loadIDOptions(); | ||
it("should NOT show consent screen for the non-required id type", () => { | ||
cy.visit("/consent-required"); | ||
|
||
cy.getIFrameBody() | ||
.find("#country") | ||
.select("Nigeria") | ||
.should("have.value", "NG"); | ||
cy.loadIDOptions(); | ||
|
||
cy.getIFrameBody().find("#id_type").select("NIN").should("have.value", "NIN"); | ||
cy.getIFrameBody() | ||
.find("#country") | ||
.select("Nigeria") | ||
.should("have.value", "NG"); | ||
|
||
cy.getIFrameBody().find("#submitConfig").click(); | ||
cy.getIFrameBody() | ||
.find("#id_type") | ||
.select("NIN") | ||
.should("have.value", "NIN"); | ||
|
||
cy.getIFrameBody().find("end-user-consent").should("not.exist"); | ||
}); | ||
cy.getIFrameBody().find("#submitConfig").click(); | ||
|
||
cy.getIFrameBody().find("end-user-consent").should("not.exist"); | ||
}); | ||
|
||
it("should NOT show consent screen when configuration is absent", () => { | ||
cy.visit("/consent-not-required"); | ||
it("should NOT show consent screen when configuration is absent", () => { | ||
cy.visit("/consent-not-required"); | ||
|
||
cy.loadIDOptions(); | ||
cy.loadIDOptions(); | ||
|
||
cy.getIFrameBody() | ||
.find("#country") | ||
.select("Nigeria") | ||
.should("have.value", "NG"); | ||
cy.getIFrameBody() | ||
.find("#country") | ||
.select("Nigeria") | ||
.should("have.value", "NG"); | ||
|
||
cy.getIFrameBody().find("#id_type").select("NIN").should("have.value", "NIN"); | ||
cy.getIFrameBody() | ||
.find("#id_type") | ||
.select("NIN") | ||
.should("have.value", "NIN"); | ||
|
||
cy.getIFrameBody().find("#submitConfig").click(); | ||
cy.getIFrameBody().find("#submitConfig").click(); | ||
|
||
cy.getIFrameBody().find("end-user-consent").should("not.exist"); | ||
cy.getIFrameBody().find("end-user-consent").should("not.exist"); | ||
|
||
cy.getIFrameBody().find("smart-camera-web").should("exist"); | ||
cy.getIFrameBody().find("smart-camera-web").should("exist"); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
describe("id-info screen", () => { | ||
beforeEach(() => { | ||
cy.loadIDOptions(); | ||
|
||
cy.visit("/"); | ||
|
||
cy.selectNINIDType(); | ||
|
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
Oops, something went wrong.