fix: e2e
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-10-19 15:10:43 +02:00
parent 390c5790d6
commit abd2d9a849
3 changed files with 13 additions and 8 deletions

View File

@ -954,6 +954,7 @@ export default {
manualInvoiceTaxArea: 'vn-autocomplete[ng-model="$ctrl.invoice.taxArea"]', manualInvoiceTaxArea: 'vn-autocomplete[ng-model="$ctrl.invoice.taxArea"]',
saveInvoice: 'button[response="accept"]', saveInvoice: 'button[response="accept"]',
globalInvoiceForm: '.vn-invoice-out-global-invoicing', globalInvoiceForm: '.vn-invoice-out-global-invoicing',
globalInvoiceClientsRange: 'vn-radio[val="clientsRange"]',
globalInvoiceDate: '[ng-model="$ctrl.invoice.invoiceDate"]', globalInvoiceDate: '[ng-model="$ctrl.invoice.invoiceDate"]',
globalInvoiceFromClient: '[ng-model="$ctrl.invoice.fromClientId"]', globalInvoiceFromClient: '[ng-model="$ctrl.invoice.fromClientId"]',
globalInvoiceToClient: '[ng-model="$ctrl.invoice.toClientId"]', globalInvoiceToClient: '[ng-model="$ctrl.invoice.toClientId"]',

View File

@ -33,6 +33,7 @@ describe('InvoiceOut global invoice path', () => {
it('should create a global invoice for charles xavier today', async() => { it('should create a global invoice for charles xavier today', async() => {
await page.pickDate(selectors.invoiceOutIndex.globalInvoiceDate); await page.pickDate(selectors.invoiceOutIndex.globalInvoiceDate);
await page.waitToClick(selectors.invoiceOutIndex.globalInvoiceClientsRange);
await page.autocompleteSearch(selectors.invoiceOutIndex.globalInvoiceFromClient, 'Petter Parker'); await page.autocompleteSearch(selectors.invoiceOutIndex.globalInvoiceFromClient, 'Petter Parker');
await page.autocompleteSearch(selectors.invoiceOutIndex.globalInvoiceToClient, 'Petter Parker'); await page.autocompleteSearch(selectors.invoiceOutIndex.globalInvoiceToClient, 'Petter Parker');
await page.waitToClick(selectors.invoiceOutIndex.saveInvoice); await page.waitToClick(selectors.invoiceOutIndex.saveInvoice);
@ -48,4 +49,15 @@ describe('InvoiceOut global invoice path', () => {
expect(currentInvoices).toBeGreaterThan(invoicesBefore); expect(currentInvoices).toBeGreaterThan(invoicesBefore);
}); });
it('should create a global invoice for all clients today', async() => {
await page.waitToClick(selectors.invoiceOutIndex.createInvoice);
await page.waitToClick(selectors.invoiceOutIndex.createGlobalInvoice);
await page.waitForSelector(selectors.invoiceOutIndex.globalInvoiceForm);
await page.pickDate(selectors.invoiceOutIndex.globalInvoiceDate);
await page.waitToClick(selectors.invoiceOutIndex.saveInvoice);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
}); });

View File

@ -108,14 +108,6 @@ describe('InvoiceOut', () => {
clientsAndAddresses: [{clientId: 1101, addressId: 121}], clientsAndAddresses: [{clientId: 1101, addressId: 121}],
invoice: controller.invoice invoice: controller.invoice
}; };
const expectedParams = {
clientId: 1101,
addressId: 121,
invoiceDate: new Date(),
maxShipped: new Date(),
companyFk: 442,
minShipped: minShipped
};
const serializedParams = $httpParamSerializer({filter}); const serializedParams = $httpParamSerializer({filter});
$httpBackend.expectGET(`Clients/findOne?${serializedParams}`).respond(200, {id: 1112}); $httpBackend.expectGET(`Clients/findOne?${serializedParams}`).respond(200, {id: 1112});