From cceff95d2af604322c1b011e2728f59c3e914ab4 Mon Sep 17 00:00:00 2001 From: Stanslav Zaytsev Date: Wed, 28 Feb 2024 13:58:27 +0300 Subject: [PATCH] fix(demo-integrations): fixed tests to run properly --- .../component-testing/predicate/predicate.cy.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/projects/demo-integrations/src/tests/component-testing/predicate/predicate.cy.ts b/projects/demo-integrations/src/tests/component-testing/predicate/predicate.cy.ts index 07f5badef..85d3454f2 100644 --- a/projects/demo-integrations/src/tests/component-testing/predicate/predicate.cy.ts +++ b/projects/demo-integrations/src/tests/component-testing/predicate/predicate.cy.ts @@ -23,12 +23,11 @@ describe('@maskito/angular | Predicate', () => { }; describe('can detect run-time changes', () => { - it('card', () => { + it('12341234abcd12341234 => 1234 1234 1234 1234', () => { cy.mount(TestInput, { componentProperties: { maskitoOptions: cardMask, - maskitoElementPredicate: element => - element.querySelectorAll('input')[0], + maskitoElementPredicate: element => element as HTMLInputElement, }, }); @@ -37,12 +36,11 @@ describe('@maskito/angular | Predicate', () => { .should('have.value', '1234 1234 1234 1234'); }); - it('name', () => { + it('12341234abcd12341234 => ABCD', () => { cy.mount(TestInput, { componentProperties: { maskitoOptions: nameMask, - maskitoElementPredicate: element => - element.querySelectorAll('input')[0], + maskitoElementPredicate: element => element as HTMLInputElement, }, }); @@ -50,12 +48,12 @@ describe('@maskito/angular | Predicate', () => { }); }); describe('supports asynchronous predicate', () => { - it('card', () => { + it('12341234abcd12341234 => 1234 1234 1234 1234', () => { cy.mount(TestInput, { componentProperties: { maskitoOptions: cardMask, maskitoElementPredicate: async element => - Promise.resolve(element.querySelectorAll('input')[0]), + Promise.resolve(element as HTMLInputElement), }, }); cy.get('input').as('card');