Skip to content

Commit

Permalink
test(demo-integrations): moved tests for multi-character-prefix from …
Browse files Browse the repository at this point in the history
…e2e to ct
  • Loading branch information
Stanslav Zaytsev committed Mar 7, 2024
1 parent a7bec35 commit 7f284a8
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {maskitoNumberOptionsGenerator} from '@maskito/kit';

import {TestInput} from '../utils';

describe('multi-character prefix "EUR " (no initial value & no caret guard)', () => {
beforeEach(() => {
cy.mount(TestInput, {
componentProperties: {
maskitoOptions: maskitoNumberOptionsGenerator({
prefix: 'EUR ',
}),
},
});
cy.get('input').focus().should('have.value', '').as('input');
});

['E', 'U', 'R'].forEach(char => {
it(`Empty input => Type "${char} => Textfield's value is "EUR "`, () => {
cy.get('@input')
.type(char)
.should('have.value', 'EUR ')
.should('have.prop', 'selectionStart', 'EUR '.length)
.should('have.prop', 'selectionEnd', 'EUR '.length);
});
});
});

0 comments on commit 7f284a8

Please sign in to comment.