-
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.
Merge branch 'main' into dependabot/npm_and_yarn/example/axios-1.7.4
- Loading branch information
Showing
27 changed files
with
599 additions
and
48 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,48 @@ | ||
<!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({ | ||
use_new_component: true, | ||
token: | ||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX3BhcmFtcyI6eyJ1c2VyX2lkIjoid2ViLXRva2VuLXRlc3QtdXNlci0xMDEiLCJqb2JfaWQiOiJ3ZWItdG9rZW4tam9iLTIzMDAiLCJqb2JfdHlwZSI6NH0sImNhbGxiYWNrX3VybCI6Imh0dHBzOi8vd2ViaG9vay5zaXRlLzFhYWE3YTdiLWFjY2ItNDBhYy04NjQzLWZkOGE4NzAzZTliZSIsImlhdCI6MTY0ODIzNTA0NCwiZXhwIjoxNjQ5ODgzMjcyfQ.FNqqYIda63uEd2pMSSnDcWmm4eXPvRRpuV9qJggGejc', | ||
product: 'smartselfie', | ||
callback_url: | ||
'https://webhook.site/1aaa7a7b-accb-40ac-8643-fd8a8703e9be', | ||
environment: 'sandbox', | ||
consent_required: { | ||
NG: ['BVN'], | ||
}, | ||
partner_details: { | ||
name: 'Test Org', | ||
logo_url: 'https://portal.usesmileid.com/favicon.ico', | ||
partner_id: '212', | ||
policy_url: 'https://usesmileid.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
77 changes: 77 additions & 0 deletions
77
packages/embed/cypress/tests/smartselfie-auth-new-design.cy.cjs
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,77 @@ | ||
describe('smartselfie authentication', () => { | ||
beforeEach(() => { | ||
cy.visit('/smartselfie-new-design'); | ||
|
||
cy.getIFrameBody().should('be.visible'); | ||
|
||
cy.intercept( | ||
{ | ||
method: 'POST', | ||
url: '*upload*', | ||
}, | ||
{ | ||
upload_url: | ||
'https://smile-uploads-development01.s3.us-west-2.amazonaws.com/videos/212/212-0000060103-0gdzke3mdtlco5k0sdfh6vifzcrd3n/smartselfie.zip', | ||
}, | ||
).as('getUploadURL'); | ||
}); | ||
|
||
describe('when a successful upload happens', () => { | ||
beforeEach(() => { | ||
cy.intercept( | ||
{ | ||
method: 'PUT', | ||
url: 'https://smile-uploads-development01.s3.us-west-2.amazonaws.com/videos/212/212-0000060103-0gdzke3mdtlco5k0sdfh6vifzcrd3n/smartselfie.zip', | ||
}, | ||
{ | ||
statusCode: 200, | ||
}, | ||
).as('successfulUpload'); | ||
cy.navigateThroughNewCameraScreens(); | ||
}); | ||
|
||
it('should show the completion screen', () => { | ||
cy.wait('@getUploadURL'); | ||
|
||
cy.wait('@successfulUpload'); | ||
cy.getIFrameBody().find('#complete-screen').should('be.visible'); | ||
}); | ||
}); | ||
|
||
describe('when the upload fails', () => { | ||
beforeEach(() => { | ||
cy.intercept( | ||
{ | ||
method: 'PUT', | ||
url: 'https://smile-uploads-development01.s3.us-west-2.amazonaws.com/videos/212/212-0000060103-0gdzke3mdtlco5k0sdfh6vifzcrd3n/smartselfie.zip', | ||
}, | ||
{ | ||
statusCode: 412, | ||
}, | ||
).as('failedUploadRequest'); | ||
cy.navigateThroughNewCameraScreens(); | ||
}); | ||
|
||
it('should show the upload failure screen', () => { | ||
cy.wait('@getUploadURL'); | ||
|
||
cy.getIFrameBody() | ||
.find('#upload-progress-screen') | ||
.should('not.be.visible'); | ||
|
||
cy.wait('@failedUploadRequest'); | ||
|
||
cy.getIFrameBody().find('#upload-failure-screen').should('be.visible'); | ||
}); | ||
|
||
it('should should retry upload when "try again" button is clicked', () => { | ||
cy.wait('@getUploadURL'); | ||
|
||
cy.wait('@failedUploadRequest'); | ||
|
||
cy.getIFrameBody().find('#retry-upload').click(); | ||
|
||
cy.wait('@failedUploadRequest'); | ||
}); | ||
}); | ||
}); |
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.