58 lines
2.1 KiB
JavaScript
58 lines
2.1 KiB
JavaScript
describe('FixedAssetBasicData', () => {
|
|
const selectors = {
|
|
resetBtn: '#st-actions > .q-btn-group > .q-btn[title="Reset"]',
|
|
saveBtn: '#st-actions > .q-btn-group > .q-btn[title="Save"]',
|
|
labelDescription: '[data-cy="Description_input"]',
|
|
investmentCheckbox: 'vnCheckboxInvestment asset',
|
|
completedCheckbox: 'vnCheckboxCompleted',
|
|
};
|
|
|
|
const updateData = {
|
|
Id: { val: '12' },
|
|
Value: { val: '100000' },
|
|
Description: { val: 'F.R.I.D.A.Y.' },
|
|
Company: { val: 'CCs', type: 'select' },
|
|
Subaccount: { val: '2800000000', type: 'select' },
|
|
Endowment: { val: '6810000000', type: 'select' },
|
|
'Element account': { val: '561.12' },
|
|
'Amort. start': { val: '1.5', type: 'date' },
|
|
'Amort. end': { val: '1.10.21', type: 'date' },
|
|
'Final date': { val: '1.11.21', type: 'date' },
|
|
Amortization: { val: '640' },
|
|
'Amort. plan': { val: '2', type: 'select' },
|
|
Group: { val: 'Chitauri', type: 'select' },
|
|
Location: { val: 'Stark tower', type: 'select' },
|
|
Discharged: { val: '1.4.25', type: 'date' },
|
|
'Cause of discharge': { val: 'Venta' },
|
|
};
|
|
|
|
beforeEach(() => {
|
|
cy.viewport(1280, 720);
|
|
cy.login('administrative');
|
|
cy.visit('#/fixed-asset/1/basic-data');
|
|
});
|
|
|
|
it('Should reset fixed asset basic data', () => {
|
|
cy.get(selectors.labelDescription)
|
|
.should('be.visible')
|
|
.click()
|
|
.invoke('text')
|
|
.then((name) => {
|
|
name = name.trim();
|
|
cy.get(selectors.labelDescription)
|
|
.click()
|
|
.type(`{selectall}{backspace}Tony Stark`);
|
|
cy.get(selectors.resetBtn).click();
|
|
cy.containContent(selectors.labelDescription, name);
|
|
});
|
|
});
|
|
|
|
it('Should edit fixed asset basic data', () => {
|
|
cy.fillInForm(updateData);
|
|
cy.dataCy(selectors.investmentCheckbox).click();
|
|
cy.dataCy(selectors.completedCheckbox).click();
|
|
cy.get(selectors.saveBtn).click();
|
|
cy.checkNotification('Data saved');
|
|
});
|
|
});
|