generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(demo-integrations): rewriting e2e tests to CT(multi-characte…
…r-prefix tests) (#1130)
- Loading branch information
1 parent
a6f7bc9
commit b2e522a
Showing
2 changed files
with
26 additions
and
20 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); | ||
}); | ||
}); | ||
}); |
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