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.
fix(core): show trailing fixed characters + duplicated fixed characte…
…r on `Drop` (#185)
- Loading branch information
1 parent
ff48b73
commit c7f6a1b
Showing
17 changed files
with
412 additions
and
49 deletions.
There are no files selected for viewing
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
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
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
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
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
87 changes: 87 additions & 0 deletions
87
projects/demo-integrations/cypress/tests/recipes/postfix/percentage.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,87 @@ | ||
import {DemoPath} from '@demo/path'; | ||
|
||
describe('Postfix | Percentage', () => { | ||
beforeEach(() => { | ||
cy.visit(`/${DemoPath.Postfix}`); | ||
cy.get('#percentage input') | ||
.should('be.visible') | ||
.first() | ||
.should('have.value', '') | ||
.focus() | ||
.as('input'); | ||
}); | ||
|
||
it('Empty input => Type 1 => 1|%', () => { | ||
cy.get('@input') | ||
.type('1') | ||
.should('have.value', '1%') | ||
.should('have.prop', 'selectionStart', 1) | ||
.should('have.prop', 'selectionEnd', 1); | ||
}); | ||
|
||
it('Empty input => Type 10 => 10|%', () => { | ||
cy.get('@input') | ||
.type('10') | ||
.should('have.value', '10%') | ||
.should('have.prop', 'selectionStart', 2) | ||
.should('have.prop', 'selectionEnd', 2); | ||
}); | ||
|
||
it('10|% => Backspace => 1|%', () => { | ||
cy.get('@input') | ||
.type('10') | ||
.type('{backspace}') | ||
.should('have.value', '1%') | ||
.should('have.prop', 'selectionStart', 1) | ||
.should('have.prop', 'selectionEnd', 1); | ||
}); | ||
|
||
it('1|% => Backspace => Empty input', () => { | ||
cy.get('@input') | ||
.type('1') | ||
.type('{backspace}') | ||
.should('have.value', '') | ||
.should('have.prop', 'selectionStart', 0) | ||
.should('have.prop', 'selectionEnd', 0); | ||
}); | ||
|
||
it('|53% => Delete => |3%', () => { | ||
cy.get('@input') | ||
.type('53') | ||
.type('{moveToStart}{del}') | ||
.should('have.value', '3%') | ||
.should('have.prop', 'selectionStart', 0) | ||
.should('have.prop', 'selectionEnd', 0); | ||
}); | ||
|
||
it('|3% => Delete => Empty input', () => { | ||
cy.get('@input') | ||
.type('3') | ||
.type('{moveToStart}{del}') | ||
.should('have.value', '') | ||
.should('have.prop', 'selectionStart', 0) | ||
.should('have.prop', 'selectionEnd', 0); | ||
}); | ||
|
||
it('cannot erase the % (by backspace)', () => { | ||
cy.get('@input') | ||
.type('42') | ||
.type('{moveToEnd}') | ||
.should('have.value', '42%') | ||
.should('have.prop', 'selectionStart', '42%'.length) | ||
.should('have.prop', 'selectionEnd', '42%'.length) | ||
.type('{backspace}') | ||
.should('have.value', '42%') | ||
.should('have.prop', 'selectionStart', '42'.length) | ||
.should('have.prop', 'selectionEnd', '42'.length); | ||
}); | ||
|
||
it('cannot erase the % (by delete)', () => { | ||
cy.get('@input') | ||
.type('42') | ||
.type('{del}') | ||
.should('have.value', '42%') | ||
.should('have.prop', 'selectionStart', '42%'.length) | ||
.should('have.prop', 'selectionEnd', '42%'.length); | ||
}); | ||
}); |
52 changes: 52 additions & 0 deletions
52
projects/demo-integrations/cypress/tests/recipes/postfix/time.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,52 @@ | ||
import {DemoPath} from '@demo/path'; | ||
|
||
describe('Postfix | Time', () => { | ||
beforeEach(() => { | ||
cy.visit(`/${DemoPath.Postfix}`); | ||
cy.get('#time input') | ||
.should('be.visible') | ||
.first() | ||
.should('have.value', '') | ||
.focus() | ||
.as('input'); | ||
}); | ||
|
||
it('Empty input => 1159 => 11:59| pm', () => { | ||
cy.get('@input') | ||
.type('1159') | ||
.should('have.value', '11:59 pm') | ||
.should('have.prop', 'selectionStart', '11:59'.length) | ||
.should('have.prop', 'selectionEnd', '11:59'.length); | ||
}); | ||
|
||
it('11:59| pm => Backspace => 11:5', () => { | ||
cy.get('@input') | ||
.type('1159') | ||
.type('{backspace}') | ||
.should('have.value', '11:5') | ||
.should('have.prop', 'selectionStart', '11:5'.length) | ||
.should('have.prop', 'selectionEnd', '11:5'.length); | ||
}); | ||
|
||
it('cannot erase the " pm" (by backspace)', () => { | ||
cy.get('@input') | ||
.type('1159') | ||
.type('{moveToEnd}') | ||
.should('have.value', '11:59 pm') | ||
.should('have.prop', 'selectionStart', '11:59 pm'.length) | ||
.should('have.prop', 'selectionEnd', '11:59 pm'.length) | ||
.type('{backspace}'.repeat(3)) | ||
.should('have.value', '11:59 pm') | ||
.should('have.prop', 'selectionStart', '11:59'.length) | ||
.should('have.prop', 'selectionEnd', '11:59'.length); | ||
}); | ||
|
||
it('cannot erase the " pm" (by delete)', () => { | ||
cy.get('@input') | ||
.type('1159') | ||
.type('{del}'.repeat(2)) | ||
.should('have.value', '11:59 pm') | ||
.should('have.prop', 'selectionStart', '11:59 p'.length) | ||
.should('have.prop', 'selectionEnd', '11:59 p'.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
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
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
Oops, something went wrong.