Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
commit
0e3aca88ae
|
@ -1,4 +1,5 @@
|
|||
describe('VnAccountNumber', () => {
|
||||
const accountInput = 'input[data-cy="supplierFiscalDataAccount_input"]';
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
|
@ -7,44 +8,30 @@ describe('VnAccountNumber', () => {
|
|||
|
||||
describe('VnInput handleInsertMode()', () => {
|
||||
it('should replace character at cursor position in insert mode', () => {
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').type(
|
||||
'{selectall}4100000001',
|
||||
);
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('{movetostart}');
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('999');
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').should(
|
||||
'have.value',
|
||||
'9990000001',
|
||||
);
|
||||
cy.get(accountInput).type('{selectall}4100000001');
|
||||
cy.get(accountInput).type('{movetostart}');
|
||||
cy.get(accountInput).type('999');
|
||||
cy.get(accountInput).should('have.value', '9990000001');
|
||||
});
|
||||
|
||||
it('should replace character at cursor position in insert mode', () => {
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').clear();
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('4100000001');
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('{movetostart}');
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('999');
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').should(
|
||||
'have.value',
|
||||
'9990000001',
|
||||
);
|
||||
cy.get(accountInput).clear();
|
||||
cy.get(accountInput).type('4100000001');
|
||||
cy.get(accountInput).type('{movetostart}');
|
||||
cy.get(accountInput).type('999');
|
||||
cy.get(accountInput).should('have.value', '9990000001');
|
||||
});
|
||||
|
||||
it('should respect maxlength prop', () => {
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').clear();
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('123456789012345');
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').should(
|
||||
'have.value',
|
||||
'1234567890',
|
||||
);
|
||||
cy.get(accountInput).clear();
|
||||
cy.get(accountInput).type('123456789012345');
|
||||
cy.get(accountInput).should('have.value', '1234567890');
|
||||
});
|
||||
});
|
||||
|
||||
it('should convert short account number to standard format', () => {
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').clear();
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('123.');
|
||||
cy.get('input[data-cy="supplierFiscalDataAccount"]').should(
|
||||
'have.value',
|
||||
'1230000000',
|
||||
);
|
||||
cy.get(accountInput).clear();
|
||||
cy.get(accountInput).type('123.');
|
||||
cy.get(accountInput).should('have.value', '1230000000');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue