@smileid/web-components 1.4.5 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/selfie/src/SelfieCaptureScreens.js +4 -1
- package/components/selfie/src/selfie-capture/SelfieCapture.js +3 -1
- package/components/signature-pad/package.json +1 -1
- package/components/smart-camera-web/src/SmartCameraWeb.js +4 -1
- package/cypress/e2e/smart-camera-web-hide-back-to-host.cy.js +61 -0
- package/package.json +1 -1
|
@@ -194,7 +194,10 @@ class SelfieCaptureScreens extends HTMLElement {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
get hideBack() {
|
|
197
|
-
return this.hasAttribute('hide-back-to-host')
|
|
197
|
+
return this.hasAttribute('hide-back-to-host') ||
|
|
198
|
+
this.hasAttribute('hide-back')
|
|
199
|
+
? 'hide-back'
|
|
200
|
+
: '';
|
|
198
201
|
}
|
|
199
202
|
|
|
200
203
|
get disableImageTests() {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IMAGE_TYPE } from '../../../../domain/constants/src/Constants';
|
|
2
2
|
import SmartCamera from '../../../../domain/camera/src/SmartCamera';
|
|
3
3
|
import styles from '../../../../styles/src/styles';
|
|
4
|
-
import
|
|
4
|
+
import packageJson from '../../../../package.json';
|
|
5
5
|
import '../../../navigation/src';
|
|
6
6
|
|
|
7
|
+
const COMPONENTS_VERSION = packageJson.version;
|
|
8
|
+
|
|
7
9
|
const DEFAULT_NO_OF_LIVENESS_FRAMES = 8;
|
|
8
10
|
|
|
9
11
|
function hasMoreThanNColors(data, n = 16) {
|
|
@@ -224,7 +224,10 @@ class SmartCameraWeb extends HTMLElement {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
get hideBackToHost() {
|
|
227
|
-
return this.hasAttribute('hide-back-to-host')
|
|
227
|
+
return this.hasAttribute('hide-back-to-host') ||
|
|
228
|
+
this.hasAttribute('hide-back')
|
|
229
|
+
? 'hide-back'
|
|
230
|
+
: '';
|
|
228
231
|
}
|
|
229
232
|
|
|
230
233
|
get allowAgentMode() {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
describe('SmartCameraWeb', () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit('/capture-back-of-id-navigation');
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it('shows attribution by default', () => {
|
|
7
|
+
cy.get('smart-camera-web')
|
|
8
|
+
.shadow()
|
|
9
|
+
.find('selfie-capture-instructions')
|
|
10
|
+
.should('be.visible');
|
|
11
|
+
cy.get('smart-camera-web')
|
|
12
|
+
.shadow()
|
|
13
|
+
.find('selfie-capture-instructions')
|
|
14
|
+
.shadow()
|
|
15
|
+
.should('contain.text', "Next, we'll take a quick selfie");
|
|
16
|
+
cy.get('smart-camera-web')
|
|
17
|
+
.shadow()
|
|
18
|
+
.find('selfie-capture-instructions')
|
|
19
|
+
.shadow()
|
|
20
|
+
.find('smileid-navigation')
|
|
21
|
+
.shadow()
|
|
22
|
+
.find('.back-button')
|
|
23
|
+
.should('be.visible');
|
|
24
|
+
cy.get('smart-camera-web')
|
|
25
|
+
.shadow()
|
|
26
|
+
.find('selfie-capture-instructions')
|
|
27
|
+
.shadow()
|
|
28
|
+
.find('#cancel')
|
|
29
|
+
.should('be.visible');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('hides back exit and cancel button when `hide-back-to-host` attribute is passed', () => {
|
|
33
|
+
cy.get('smart-camera-web')
|
|
34
|
+
.invoke('attr', 'hide-back-to-host', 'true')
|
|
35
|
+
.should('have.attr', 'hide-back-to-host', 'true');
|
|
36
|
+
|
|
37
|
+
cy.get('smart-camera-web')
|
|
38
|
+
.shadow()
|
|
39
|
+
.find('selfie-capture-instructions')
|
|
40
|
+
.should('be.visible');
|
|
41
|
+
cy.get('smart-camera-web')
|
|
42
|
+
.shadow()
|
|
43
|
+
.find('selfie-capture-instructions')
|
|
44
|
+
.shadow()
|
|
45
|
+
.should('contain.text', "Next, we'll take a quick selfie");
|
|
46
|
+
cy.get('smart-camera-web')
|
|
47
|
+
.shadow()
|
|
48
|
+
.find('selfie-capture-instructions')
|
|
49
|
+
.shadow()
|
|
50
|
+
.find('smileid-navigation')
|
|
51
|
+
.shadow()
|
|
52
|
+
.get('.back-button')
|
|
53
|
+
.should('not.exist');
|
|
54
|
+
cy.get('smart-camera-web')
|
|
55
|
+
.shadow()
|
|
56
|
+
.find('selfie-capture-instructions')
|
|
57
|
+
.shadow()
|
|
58
|
+
.get('#cancel')
|
|
59
|
+
.should('not.exist');
|
|
60
|
+
});
|
|
61
|
+
});
|