Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2622-route_tickets_refactor

This commit is contained in:
Carlos Jimenez Ruiz 2020-12-18 13:17:04 +01:00
commit d0e6a8a582
5 changed files with 65 additions and 3 deletions

View File

@ -0,0 +1,2 @@
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES ('PayDem', '*', 'READ', 'ALLOW', 'ROLE', 'employee');

View File

@ -960,5 +960,11 @@ export default {
province: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.provinceFk"]',
country: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.countryFk"]',
saveButton: 'vn-supplier-fiscal-data button[type="submit"]',
},
supplierBillingData: {
payMethod: 'vn-supplier-billing-data vn-autocomplete[ng-model="$ctrl.supplier.payMethodFk"]',
payDem: 'vn-supplier-billing-data vn-autocomplete[ng-model="$ctrl.supplier.payDemFk"]',
payDay: 'vn-supplier-billing-data vn-input-number[ng-model="$ctrl.supplier.payDay"]',
saveButton: 'vn-supplier-billing-data button[type=submit]'
}
};

View File

@ -0,0 +1,52 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Supplier billing data path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('administrative', 'supplier');
await page.accessToSearchResult('442');
await page.accessToSection('supplier.card.billingData');
});
afterAll(async() => {
await browser.close();
});
it('should edit the billing data', async() => {
await page.autocompleteSearch(selectors.supplierBillingData.payMethod, 'PayMethod with IBAN');
await page.autocompleteSearch(selectors.supplierBillingData.payDem, '10');
await page.clearInput(selectors.supplierBillingData.payDay);
await page.write(selectors.supplierBillingData.payDay, '19');
await page.waitToClick(selectors.supplierBillingData.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should reload the section', async() => {
await page.reloadSection('supplier.card.billingData');
});
it('should check the pay method was edited', async() => {
const result = await page.waitToGetProperty(selectors.supplierBillingData.payMethod, 'value');
expect(result).toEqual('PayMethod with IBAN');
});
it('should check the payDem was edited', async() => {
const result = await page.waitToGetProperty(selectors.supplierBillingData.payDem, 'value');
expect(result).toEqual('10');
});
it('should check the pay day was edited', async() => {
const result = await page.waitToGetProperty(selectors.supplierBillingData.payDay, 'value');
expect(result).toEqual('19');
});
});

View File

@ -52,12 +52,13 @@
<vn-button-bar>
<vn-submit
label="Save"
ng-if="watcher.dataChanged()"
disabled="!watcher.dataChanged()"
vn-acl="salesAssistant">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
ng-if="watcher.dataChanged()"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>

View File

@ -84,7 +84,8 @@
"description": "Billing data",
"params": {
"supplier": "$ctrl.supplier"
}
},
"acl": ["administrative"]
}
]
}