generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(demo-integrations): moved tests for multi-character-prefix from …
…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.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...egrations/src/tests/component-testing/multi-character-prefix/multi-character-prefix.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); | ||
}); |