Skip to content

Commit

Permalink
fix(demo-integrations): fixed tests to run properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanslav Zaytsev committed Feb 28, 2024
1 parent 43b47d0 commit cceff95
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
});

Expand All @@ -37,25 +36,24 @@ 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,
},
});

cy.get('input').type('12341234abcd12341234').should('have.value', 'ABCD');
});
});
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');
Expand Down

0 comments on commit cceff95

Please sign in to comment.