diff --git a/app/assets/images/idv/capture-tips-clean.svg b/app/assets/images/idv/capture-tips-clean.svg
deleted file mode 100644
index 4a2211ea7e0..00000000000
--- a/app/assets/images/idv/capture-tips-clean.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/assets/images/idv/capture-tips-lighting.svg b/app/assets/images/idv/capture-tips-lighting.svg
deleted file mode 100644
index d29950af403..00000000000
--- a/app/assets/images/idv/capture-tips-lighting.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/assets/images/idv/capture-tips-surface.svg b/app/assets/images/idv/capture-tips-surface.svg
deleted file mode 100644
index 5a9bcb6edf9..00000000000
--- a/app/assets/images/idv/capture-tips-surface.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/packages/document-capture/components/capture-advice.jsx b/app/javascript/packages/document-capture/components/capture-advice.jsx
deleted file mode 100644
index 74c0a81a1bf..00000000000
--- a/app/javascript/packages/document-capture/components/capture-advice.jsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import { useI18n } from '@18f/identity-react-i18n';
-import { getAssetPath } from '@18f/identity-assets';
-import Warning from './warning';
-import DocumentCaptureTroubleshootingOptions from './document-capture-troubleshooting-options';
-
-/** @typedef {import('@18f/identity-components/troubleshooting-options').TroubleshootingOption} TroubleshootingOption */
-
-/**
- * @typedef CaptureAdviceProps
- *
- * @prop {() => void} onTryAgain
- * @prop {boolean} isAssessedAsGlare
- * @prop {boolean} isAssessedAsBlurry
- */
-
-/**
- * @param {CaptureAdviceProps} props
- */
-function CaptureAdvice({ onTryAgain, isAssessedAsGlare, isAssessedAsBlurry }) {
- const { t } = useI18n();
-
- return (
-
- }
- >
-
- {isAssessedAsGlare && t('doc_auth.tips.capture_troubleshooting_glare')}
- {isAssessedAsBlurry && t('doc_auth.tips.capture_troubleshooting_blurry')}{' '}
- {t('doc_auth.tips.capture_troubleshooting_lead')}
-
-
- -
-
- {t('doc_auth.tips.capture_troubleshooting_surface')}
-
- -
-
- {t('doc_auth.tips.capture_troubleshooting_lighting')}
-
- -
-
- {t('doc_auth.tips.capture_troubleshooting_clean')}
-
-
-
- );
-}
-
-export default CaptureAdvice;
diff --git a/app/javascript/packages/document-capture/components/capture-troubleshooting.jsx b/app/javascript/packages/document-capture/components/capture-troubleshooting.jsx
deleted file mode 100644
index b65878113dc..00000000000
--- a/app/javascript/packages/document-capture/components/capture-troubleshooting.jsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { useContext, useState } from 'react';
-import { useDidUpdateEffect } from '@18f/identity-react-hooks';
-import { FormStepsContext } from '@18f/identity-form-steps';
-import FailedCaptureAttemptsContext from '../context/failed-capture-attempts';
-import AnalyticsContext from '../context/analytics';
-import CallbackOnMount from './callback-on-mount';
-import CaptureAdvice from './capture-advice';
-
-/** @typedef {import('react').ReactNode} ReactNode */
-
-/**
- * @typedef CaptureTroubleshootingProps
- *
- * @prop {ReactNode} children
- */
-
-/**
- * @param {CaptureTroubleshootingProps} props
- */
-function CaptureTroubleshooting({ children }) {
- const { trackEvent } = useContext(AnalyticsContext);
- const [didShowTroubleshooting, setDidShowTroubleshooting] = useState(false);
- const { failedCaptureAttempts, maxFailedAttemptsBeforeTips, lastAttemptMetadata } = useContext(
- FailedCaptureAttemptsContext,
- );
- const { onPageTransition } = useContext(FormStepsContext);
- useDidUpdateEffect(onPageTransition, [didShowTroubleshooting]);
- const { isAssessedAsGlare, isAssessedAsBlurry } = lastAttemptMetadata;
-
- function onCaptureTipsShown() {
- trackEvent('IdV: Capture troubleshooting shown', lastAttemptMetadata);
-
- onPageTransition();
- }
-
- function onCaptureTipsDismissed() {
- trackEvent('IdV: Capture troubleshooting dismissed');
-
- setDidShowTroubleshooting(true);
- }
-
- return failedCaptureAttempts >= maxFailedAttemptsBeforeTips && !didShowTroubleshooting ? (
-
-
-
- ) : (
- <>{children}>
- );
-}
-
-export default CaptureTroubleshooting;
diff --git a/app/javascript/packages/document-capture/components/documents-step.jsx b/app/javascript/packages/document-capture/components/documents-step.jsx
index 2ced6fbccdb..1f13d73ec34 100644
--- a/app/javascript/packages/document-capture/components/documents-step.jsx
+++ b/app/javascript/packages/document-capture/components/documents-step.jsx
@@ -7,7 +7,6 @@ import HybridDocCaptureWarning from './hybrid-doc-capture-warning';
import DocumentSideAcuantCapture from './document-side-acuant-capture';
import DeviceContext from '../context/device';
import UploadContext from '../context/upload';
-import CaptureTroubleshooting from './capture-troubleshooting';
import DocumentCaptureTroubleshootingOptions from './document-capture-troubleshooting-options';
import TipList from './tip-list';
@@ -47,7 +46,7 @@ function DocumentsStep({
const { flowPath } = useContext(UploadContext);
return (
-
+ <>
{flowPath === 'hybrid' && }
{t('doc_auth.headings.document_capture')}
{t('doc_auth.info.document_capture_intro_acknowledgment')}
@@ -73,7 +72,7 @@ function DocumentsStep({
{isLastStep ? : }
-
+ >
);
}
diff --git a/app/javascript/packages/document-capture/context/failed-capture-attempts.tsx b/app/javascript/packages/document-capture/context/failed-capture-attempts.tsx
index b55935a7091..378e6f5b5b9 100644
--- a/app/javascript/packages/document-capture/context/failed-capture-attempts.tsx
+++ b/app/javascript/packages/document-capture/context/failed-capture-attempts.tsx
@@ -25,10 +25,6 @@ interface FailedCaptureAttemptsContextInterface {
*/
onFailedSubmissionAttempt: () => void;
- /**
- * Number of failed attempts before showing tips
- */
- maxFailedAttemptsBeforeTips: number;
/**
* The maximum number of failed Acuant capture attempts
* before use of the native camera option is triggered
@@ -78,7 +74,6 @@ const FailedCaptureAttemptsContext = createContext {},
maxCaptureAttemptsBeforeNativeCamera: Infinity,
maxSubmissionAttemptsBeforeNativeCamera: Infinity,
- maxFailedAttemptsBeforeTips: Infinity,
lastAttemptMetadata: DEFAULT_LAST_ATTEMPT_METADATA,
forceNativeCamera: false,
});
@@ -87,14 +82,12 @@ FailedCaptureAttemptsContext.displayName = 'FailedCaptureAttemptsContext';
interface FailedCaptureAttemptsContextProviderProps {
children: ReactNode;
- maxFailedAttemptsBeforeTips: number;
maxCaptureAttemptsBeforeNativeCamera: number;
maxSubmissionAttemptsBeforeNativeCamera: number;
}
function FailedCaptureAttemptsContextProvider({
children,
- maxFailedAttemptsBeforeTips,
maxCaptureAttemptsBeforeNativeCamera,
maxSubmissionAttemptsBeforeNativeCamera,
}: FailedCaptureAttemptsContextProviderProps) {
@@ -128,7 +121,6 @@ function FailedCaptureAttemptsContextProvider({
onFailedSubmissionAttempt,
maxCaptureAttemptsBeforeNativeCamera,
maxSubmissionAttemptsBeforeNativeCamera,
- maxFailedAttemptsBeforeTips,
lastAttemptMetadata,
forceNativeCamera,
}}
diff --git a/app/javascript/packs/document-capture.tsx b/app/javascript/packs/document-capture.tsx
index d70821ccd6e..40d5a17fa5a 100644
--- a/app/javascript/packs/document-capture.tsx
+++ b/app/javascript/packs/document-capture.tsx
@@ -24,7 +24,6 @@ import type { FlowPath, DeviceContextValue } from '@18f/identity-document-captur
*/
interface AppRootData {
helpCenterRedirectUrl: string;
- maxCaptureAttemptsBeforeTips: string;
maxAttemptsBeforeNativeCamera: string;
acuantSdkUpgradeABTestingEnabled: string;
useAlternateSdk: string;
@@ -72,7 +71,6 @@ const formData: Record = {
const {
helpCenterRedirectUrl: helpCenterRedirectURL,
- maxCaptureAttemptsBeforeTips,
maxCaptureAttemptsBeforeNativeCamera,
maxSubmissionAttemptsBeforeNativeCamera,
acuantVersion,
@@ -142,7 +140,6 @@ const App = composeComponents(
[
FailedCaptureAttemptsContextProvider,
{
- maxFailedAttemptsBeforeTips: Number(maxCaptureAttemptsBeforeTips),
maxCaptureAttemptsBeforeNativeCamera: Number(maxCaptureAttemptsBeforeNativeCamera),
maxSubmissionAttemptsBeforeNativeCamera: Number(maxSubmissionAttemptsBeforeNativeCamera),
},
diff --git a/app/views/idv/shared/_document_capture.html.erb b/app/views/idv/shared/_document_capture.html.erb
index 75c74637e52..41b1b41d88d 100644
--- a/app/views/idv/shared/_document_capture.html.erb
+++ b/app/views/idv/shared/_document_capture.html.erb
@@ -18,7 +18,6 @@
glare_threshold: IdentityConfig.store.doc_auth_client_glare_threshold,
sharpness_threshold: IdentityConfig.store.doc_auth_client_sharpness_threshold,
status_poll_interval_ms: IdentityConfig.store.poll_rate_for_verify_in_seconds * 1000,
- max_capture_attempts_before_tips: IdentityConfig.store.doc_auth_max_capture_attempts_before_tips,
max_capture_attempts_before_native_camera: IdentityConfig.store.doc_auth_max_capture_attempts_before_native_camera,
max_submission_attempts_before_native_camera: IdentityConfig.store.doc_auth_max_submission_attempts_before_native_camera,
acuant_sdk_upgrade_a_b_testing_enabled: acuant_sdk_upgrade_a_b_testing_enabled,
diff --git a/config/application.yml.default b/config/application.yml.default
index da29cc78035..53c502edb8c 100644
--- a/config/application.yml.default
+++ b/config/application.yml.default
@@ -90,7 +90,6 @@ doc_auth_error_dpi_threshold: 290
doc_auth_error_glare_threshold: 40
doc_auth_error_sharpness_threshold: 40
doc_auth_max_attempts: 5
-doc_auth_max_capture_attempts_before_tips: 20
doc_auth_max_capture_attempts_before_native_camera: 3
doc_auth_max_submission_attempts_before_native_camera: 3
doc_capture_request_valid_for_minutes: 15
diff --git a/config/locales/doc_auth/en.yml b/config/locales/doc_auth/en.yml
index 3aede3dfe7f..9a0ed82f110 100644
--- a/config/locales/doc_auth/en.yml
+++ b/config/locales/doc_auth/en.yml
@@ -129,7 +129,6 @@ en:
information below is incorrect, please %{link_html} of your
state‑issued ID.
capture_scan_warning_link: upload new photos
- capture_troubleshooting_tips: Having trouble adding your state‑issued ID?
document_capture: Add photos of your ID
document_capture_back: Back of your ID
document_capture_front: Front of your ID
@@ -225,18 +224,6 @@ en:
address. This takes about 3 to 7 business days.'
welcome: 'You will need your:'
tips:
- capture_troubleshooting_blurry: The photo you added is too blurry.
- capture_troubleshooting_clean: Make sure that the barcode is not damaged or
- dirty and all the information on your ID can be read.
- capture_troubleshooting_clean_image: Back of an ID
- capture_troubleshooting_glare: The photo you added has glare.
- capture_troubleshooting_lead: 'Here are some tips for taking a successful photo:'
- capture_troubleshooting_lighting: Make sure there is plenty of light. Indirect
- sunlight is best. Avoid glares, shadows and reflections.
- capture_troubleshooting_lighting_image: Sun with a cloud
- capture_troubleshooting_surface: Take a photo on a flat surface with a dark
- background. Make sure the edges of your ID are clear.
- capture_troubleshooting_surface_image: Front of an ID
document_capture_header_text: 'For best results:'
document_capture_hint: Must be a JPG or PNG
document_capture_id_text1: Use a dark background
diff --git a/config/locales/doc_auth/es.yml b/config/locales/doc_auth/es.yml
index 9c58485dc0c..37e96066ac6 100644
--- a/config/locales/doc_auth/es.yml
+++ b/config/locales/doc_auth/es.yml
@@ -154,7 +154,6 @@ es:
información que aparece a continuación es incorrecta, por favor,
%{link_html} de su ID emitido por el estado.
capture_scan_warning_link: suba nuevas fotos
- capture_troubleshooting_tips: '¿Tiene problemas para agregar su identificación emitida por el estado?'
document_capture: Incluir fotos de su identificación
document_capture_back: Parte trasera de su documento de identidad
document_capture_front: Parte delantera de su documento de identidad
@@ -258,20 +257,6 @@ es:
domicilio. Esto tarda entre 3 y 7 días laborables.'
welcome: 'Necesitará su:'
tips:
- capture_troubleshooting_blurry: La foto que adjuntó está demasiado borrosa.
- capture_troubleshooting_clean: Asegúrese de que el código de barras no esté
- dañado o sucio y que se pueda leer toda la información de su
- identificación.
- capture_troubleshooting_clean_image: Parte posterior de un documento de identidad
- capture_troubleshooting_glare: La foto que adjuntó tiene destellos.
- capture_troubleshooting_lead: 'Estos son algunos consejos para tomar una buena foto:'
- capture_troubleshooting_lighting: Asegúrese de que haya suficiente luz. Lo mejor
- es usar luz solar indirecta. Evite destellos, sombras y reflejos.
- capture_troubleshooting_lighting_image: Sol con nube
- capture_troubleshooting_surface: Tome la foto en una superficie plana y con un
- fondo oscuro. Asegúrese de que los bordes de su identificación sean
- visibles.
- capture_troubleshooting_surface_image: Parte frontal de un documento de identidad
document_capture_header_text: 'Para obtener los mejores resultados:'
document_capture_hint: Debe ser un JPG o PNG
document_capture_id_text1: Use un fondo oscuro
diff --git a/config/locales/doc_auth/fr.yml b/config/locales/doc_auth/fr.yml
index 4f990b3a734..1a2c9ce03a2 100644
--- a/config/locales/doc_auth/fr.yml
+++ b/config/locales/doc_auth/fr.yml
@@ -161,7 +161,6 @@ fr:
pièce d’identité. Si les informations ci-dessous sont incorrectes,
veuillez %{link_html} de votre carte d’identité délivrée par l’État.
capture_scan_warning_link: télécharger de nouvelles photos
- capture_troubleshooting_tips: Vous rencontrez des difficultés pour ajouter votre pièce d’identité?
document_capture: Ajoutez des photos de votre pièce d’identité
document_capture_back: Verso de votre carte d’identité
document_capture_front: Recto de votre carte d’identité
@@ -268,21 +267,6 @@ fr:
ouvrables.'
welcome: 'Vous aurez besoin de votre:'
tips:
- capture_troubleshooting_blurry: La photo que vous avez ajoutée est trop floue.
- capture_troubleshooting_clean: Assurez-vous que le code-barres ne soit pas
- endommagé ou sale et que toutes les informations figurant sur votre
- pièce d’identité soient lisibles.
- capture_troubleshooting_clean_image: Verso de la carte d’identité
- capture_troubleshooting_glare: La photo que vous avez ajoutée est éblouissante.
- capture_troubleshooting_lead: 'Voici quelques conseils pour réussir votre photo:'
- capture_troubleshooting_lighting: Assurez-vous que la luminosité soit
- suffisante. La lumière indirecte du soleil est la meilleure. Évitez les
- éblouissements, les ombres et les reflets.
- capture_troubleshooting_lighting_image: Soleil avec nuage
- capture_troubleshooting_surface: Prenez une photo sur une surface plane avec un
- fond sombre. Assurez-vous que les bords de votre pièce d’identité soient
- dégagés.
- capture_troubleshooting_surface_image: Recto de la carte d’identité
document_capture_header_text: 'Pour obtenir les meilleurs résultats:'
document_capture_hint: Doit être un JPG ou PNG
document_capture_id_text1: Utilisez un fond sombre
diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml
index 904b50b20d0..53349bd78e9 100644
--- a/config/locales/idv/en.yml
+++ b/config/locales/idv/en.yml
@@ -280,7 +280,6 @@ en:
headings:
missing_required_items: Are you missing one of these items?
need_assistance: 'Need immediate assistance? Here’s how to get help:'
- still_having_trouble: Still having trouble?
options:
contact_support: Contact %{app_name} Support
doc_capture_tips: More tips for adding photos of your ID
diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml
index dfc31224ba7..2f6cdba337f 100644
--- a/config/locales/idv/es.yml
+++ b/config/locales/idv/es.yml
@@ -291,7 +291,6 @@ es:
headings:
missing_required_items: '¿Le falta alguno de estos puntos?'
need_assistance: '¿Necesita ayuda inmediata? Así es como puede obtener ayuda:'
- still_having_trouble: '¿Sigue teniendo dificultades?'
options:
contact_support: Póngase en contacto con el servicio de asistencia de %{app_name}
doc_capture_tips: Más consejos para agregar fotos de su identificación
diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml
index b7eab6d861f..47316f25155 100644
--- a/config/locales/idv/fr.yml
+++ b/config/locales/idv/fr.yml
@@ -311,7 +311,6 @@ fr:
missing_required_items: Est-ce qu’il vous manque un de ces éléments?
need_assistance: 'Avez-vous besoin d’une assistance immédiate? Voici comment
obtenir de l’aide:'
- still_having_trouble: Vous rencontrez toujours des difficultés?
options:
contact_support: Contacter le service d’assistance de %{app_name}
doc_capture_tips: Plus de conseils pour ajouter des photos de votre carte d’identité
diff --git a/lib/identity_config.rb b/lib/identity_config.rb
index 49eceb82c3f..78f1b56f4d6 100644
--- a/lib/identity_config.rb
+++ b/lib/identity_config.rb
@@ -189,7 +189,6 @@ def self.build_store(config_map)
config.add(:doc_auth_extend_timeout_by_minutes, type: :integer)
config.add(:doc_auth_max_attempts, type: :integer)
config.add(:doc_auth_max_capture_attempts_before_native_camera, type: :integer)
- config.add(:doc_auth_max_capture_attempts_before_tips, type: :integer)
config.add(:doc_auth_max_submission_attempts_before_native_camera, type: :integer)
config.add(:doc_auth_s3_request_timeout, type: :integer)
config.add(:doc_auth_vendor, type: :string)
diff --git a/spec/javascript/packages/document-capture/components/capture-advice-spec.jsx b/spec/javascript/packages/document-capture/components/capture-advice-spec.jsx
deleted file mode 100644
index 4f8be728db4..00000000000
--- a/spec/javascript/packages/document-capture/components/capture-advice-spec.jsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import userEvent from '@testing-library/user-event';
-import sinon from 'sinon';
-import { AnalyticsContext } from '@18f/identity-document-capture';
-import CaptureAdvice from '@18f/identity-document-capture/components/capture-advice';
-import { render } from '../../../support/document-capture';
-
-describe('document-capture/components/capture-advice', () => {
- it('logs warning events', async () => {
- const trackEvent = sinon.spy();
-
- const { getByRole } = render(
-
- {}} />
- ,
- );
-
- expect(trackEvent).to.have.been.calledWith('IdV: warning shown', {
- location: 'doc_auth_capture_advice',
- remaining_attempts: undefined,
- });
-
- const button = getByRole('button');
- await userEvent.click(button);
-
- expect(trackEvent).to.have.been.calledWith('IdV: warning action triggered', {
- location: 'doc_auth_capture_advice',
- });
- });
-});
diff --git a/spec/javascript/packages/document-capture/components/capture-troubleshooting-spec.jsx b/spec/javascript/packages/document-capture/components/capture-troubleshooting-spec.jsx
deleted file mode 100644
index 10e6e9b8419..00000000000
--- a/spec/javascript/packages/document-capture/components/capture-troubleshooting-spec.jsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import sinon from 'sinon';
-import { useContext } from 'react';
-import userEvent from '@testing-library/user-event';
-import {
- AnalyticsContext,
- FailedCaptureAttemptsContext,
- FailedCaptureAttemptsContextProvider,
-} from '@18f/identity-document-capture';
-import CaptureTroubleshooting from '@18f/identity-document-capture/components/capture-troubleshooting';
-import { FormStepsContext } from '@18f/identity-form-steps';
-import { render } from '../../../support/document-capture';
-
-describe('document-capture/context/capture-troubleshooting', () => {
- it('shows children by default if not exceeded max failed attempts', () => {
- const { getByText } = render(
-
- Default children
- ,
- );
-
- expect(getByText('Default children')).to.be.ok();
- });
-
- it('shows capture advice if exceeded max failed attempts', () => {
- const { getByText } = render(
-
- Default children
- ,
- );
-
- expect(() => getByText('Default children')).to.throw();
- expect(getByText('doc_auth.headings.capture_troubleshooting_tips')).to.be.ok();
- });
-
- it('shows children again after clicking try again', async () => {
- const { getByRole, getByText } = render(
-
- Default children
- ,
- );
-
- const tryAgainButton = getByRole('button', { name: 'idv.failure.button.warning' });
- await userEvent.click(tryAgainButton);
-
- expect(getByText('Default children')).to.be.ok();
- });
-
- it('triggers content resets', async () => {
- const onPageTransition = sinon.spy();
- function FailButton() {
- return (
-
- );
- }
- const { getByRole } = render(
-
-
-
-
-
-
- ,
- );
-
- expect(onPageTransition).not.to.have.been.called();
-
- const failButton = getByRole('button', { name: 'Fail' });
- await userEvent.click(failButton);
- expect(onPageTransition).to.have.been.calledOnce();
-
- const tryAgainButton = getByRole('button', { name: 'idv.failure.button.warning' });
- await userEvent.click(tryAgainButton);
- expect(onPageTransition).to.have.been.calledTwice();
- });
-
- it('logs events', async () => {
- const trackEvent = sinon.spy();
- const { getByRole } = render(
-
-
- Default children
-
- ,
- );
-
- expect(trackEvent).to.have.been.calledTwice();
- expect(trackEvent).to.have.been.calledWith('IdV: Capture troubleshooting shown', {
- isAssessedAsGlare: false,
- isAssessedAsBlurry: false,
- isAssessedAsUnsupported: false,
- });
-
- const tryAgainButton = getByRole('button', { name: 'idv.failure.button.warning' });
- await userEvent.click(tryAgainButton);
-
- expect(trackEvent.callCount).to.equal(4);
- expect(trackEvent).to.have.been.calledWith('IdV: Capture troubleshooting dismissed');
- });
-});
diff --git a/spec/javascript/packages/document-capture/components/documents-step-spec.jsx b/spec/javascript/packages/document-capture/components/documents-step-spec.jsx
index eaaf5941bcd..11b2239ab51 100644
--- a/spec/javascript/packages/document-capture/components/documents-step-spec.jsx
+++ b/spec/javascript/packages/document-capture/components/documents-step-spec.jsx
@@ -4,18 +4,13 @@ import { t } from '@18f/identity-i18n';
import {
DeviceContext,
ServiceProviderContextProvider,
- FailedCaptureAttemptsContextProvider,
- AcuantContextProvider,
UploadContextProvider,
} from '@18f/identity-document-capture';
import DocumentsStep from '@18f/identity-document-capture/components/documents-step';
-import { AcuantDocumentType } from '@18f/identity-document-capture/components/acuant-camera';
-import { render, useAcuant } from '../../../support/document-capture';
+import { render } from '../../../support/document-capture';
import { getFixtureFile } from '../../../support/file';
describe('document-capture/components/documents-step', () => {
- const { initialize } = useAcuant();
-
it('renders with front and back inputs', () => {
const { getByLabelText } = render();
@@ -55,48 +50,6 @@ describe('document-capture/components/documents-step', () => {
expect(() => getByText('doc_auth.tips.document_capture_id_text4')).not.to.throw();
});
- it('renders additional tips after failed attempts', async () => {
- const { getByLabelText, getByText, findByRole } = render(
-
-
-
- {}} />
-
-
- ,
- );
-
- initialize();
- const result = { sharpness: 100, image: { data: '' }, cardType: AcuantDocumentType.ID };
-
- window.AcuantCameraUI.start.callsFake(({ onCropped }) => onCropped({ ...result, glare: 10 }));
- await userEvent.click(getByLabelText('doc_auth.headings.document_capture_front'));
-
- // Reset after successful attempt.
- window.AcuantCameraUI.start.callsFake(({ onCropped }) => onCropped({ ...result, glare: 80 }));
- await userEvent.click(getByLabelText('doc_auth.headings.document_capture_front'));
-
- // Fail twice more to trigger troubleshooting.
- window.AcuantCameraUI.start.callsFake(({ onCropped }) => onCropped({ ...result, glare: 10 }));
- await userEvent.click(getByLabelText('doc_auth.headings.document_capture_front'));
- await userEvent.click(getByLabelText('doc_auth.headings.document_capture_front'));
-
- getByText(
- 'doc_auth.tips.capture_troubleshooting_glare doc_auth.tips.capture_troubleshooting_lead',
- );
-
- await userEvent.click(await findByRole('button', { name: 'idv.failure.button.warning' }));
-
- // Only show troubleshooting a single time, even after 2 more failed attempts.
- await userEvent.click(getByLabelText('doc_auth.headings.document_capture_front'));
- await userEvent.click(getByLabelText('doc_auth.headings.document_capture_front'));
- expect(() =>
- getByText(
- 'doc_auth.tips.capture_troubleshooting_glare doc_auth.tips.capture_troubleshooting_lead',
- ),
- ).to.throw();
- });
-
it('renders troubleshooting options', () => {
const { getByRole } = render(
{
'onFailedCaptureAttempt',
'onFailedSubmissionAttempt',
'onResetFailedCaptureAttempts',
- 'maxFailedAttemptsBeforeTips',
'maxCaptureAttemptsBeforeNativeCamera',
'maxSubmissionAttemptsBeforeNativeCamera',
'lastAttemptMetadata',
@@ -31,7 +30,6 @@ describe('document-capture/context/failed-capture-attempts', () => {
expect(result.current.onFailedSubmissionAttempt).to.be.a('function');
expect(result.current.onFailedCaptureAttempt).to.be.a('function');
expect(result.current.onResetFailedCaptureAttempts).to.be.a('function');
- expect(result.current.maxFailedAttemptsBeforeTips).to.be.a('number');
expect(result.current.maxCaptureAttemptsBeforeNativeCamera).to.be.a('number');
expect(result.current.lastAttemptMetadata).to.be.an('object');
});
@@ -40,9 +38,7 @@ describe('document-capture/context/failed-capture-attempts', () => {
it('sets increments on onFailedCaptureAttempt', () => {
const { result } = renderHook(() => useContext(FailedCaptureAttemptsContext), {
wrapper: ({ children }) => (
-
- {children}
-
+ {children}
),
});
@@ -53,7 +49,7 @@ describe('document-capture/context/failed-capture-attempts', () => {
it('sets metadata from onFailedCaptureAttempt', () => {
const { result } = renderHook(() => useContext(FailedCaptureAttemptsContext), {
- wrapper: ({ children }) => {children},
+ wrapper: ({ children }) => {children},
});
const metadata = { isAssessedAsGlare: true, isAssessedAsBlurry: false };
@@ -69,9 +65,7 @@ describe('FailedCaptureAttemptsContext testing of forceNativeCamera logic', () =
it('Updating to a number of failed captures less than maxCaptureAttemptsBeforeNativeCamera will keep forceNativeCamera as false', () => {
const { result, rerender } = renderHook(() => useContext(FailedCaptureAttemptsContext), {
wrapper: ({ children }) => (
-
- {children}
-
+ {children}
),
});
result.current.onFailedCaptureAttempt({
@@ -86,9 +80,7 @@ describe('FailedCaptureAttemptsContext testing of forceNativeCamera logic', () =
it('Updating to a number of failed submissions less than maxSubmissionAttemptsBeforeNativeCamera will keep forceNativeCamera as false', () => {
const { result, rerender } = renderHook(() => useContext(FailedCaptureAttemptsContext), {
wrapper: ({ children }) => (
-
- {children}
-
+ {children}
),
});
result.current.onFailedSubmissionAttempt();
@@ -100,9 +92,7 @@ describe('FailedCaptureAttemptsContext testing of forceNativeCamera logic', () =
it('Updating failed captures to a number gte the maxCaptureAttemptsBeforeNativeCamera will set forceNativeCamera to true', () => {
const { result, rerender } = renderHook(() => useContext(FailedCaptureAttemptsContext), {
wrapper: ({ children }) => (
-
- {children}
-
+ {children}
),
});
result.current.onFailedCaptureAttempt({
@@ -129,9 +119,7 @@ describe('FailedCaptureAttemptsContext testing of forceNativeCamera logic', () =
it('Updating failed submissions to a number gte the maxSubmissionAttemptsBeforeNativeCamera will set forceNativeCamera to true', () => {
const { result, rerender } = renderHook(() => useContext(FailedCaptureAttemptsContext), {
wrapper: ({ children }) => (
-
- {children}
-
+ {children}
),
});
result.current.onFailedSubmissionAttempt();
@@ -152,7 +140,6 @@ describe('FailedCaptureAttemptsContext testing of forceNativeCamera logic', () =
{children}
@@ -189,7 +176,7 @@ describe('maxCaptureAttemptsBeforeNativeCamera logging tests', () => {
-
+
{acuantCaptureComponent}
{children}
@@ -218,7 +205,7 @@ describe('maxCaptureAttemptsBeforeNativeCamera logging tests', () => {
-
+
{acuantCaptureComponent}
{children}
@@ -248,7 +235,6 @@ describe('maxCaptureAttemptsBeforeNativeCamera logging tests', () => {
{acuantCaptureComponent}
{children}