diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 44f882638..c5062c3e9 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -91,5 +91,6 @@ "The observation type can't be repeated": "The observation type can't be repeated", "New ticket request has been created with price": "New ticket request has been created *'{{description}}'* for day *{{shipped}}*, with a quantity of *{{quantity}}* and a price of *{{price}} €*", "New ticket request has been created": "New ticket request has been created *'{{description}}'* for day *{{shipped}}*, with a quantity of *{{quantity}}*", - "There's a new urgent ticket": "There's a new urgent ticket: [{{title}}](https://cau.verdnatura.es/WorkOrder.do?woMode=viewWO&woID={{issueId}})" + "There's a new urgent ticket": "There's a new urgent ticket: [{{title}}](https://cau.verdnatura.es/WorkOrder.do?woMode=viewWO&woID={{issueId}})", + "Swift / BIC cannot be empty": "Swift / BIC cannot be empty" } \ No newline at end of file diff --git a/modules/client/back/methods/client/specs/lastActiveTickets.spec.js b/modules/client/back/methods/client/specs/lastActiveTickets.spec.js new file mode 100644 index 000000000..8d06e0584 --- /dev/null +++ b/modules/client/back/methods/client/specs/lastActiveTickets.spec.js @@ -0,0 +1,18 @@ +const app = require('vn-loopback/server/server'); + +describe('Client last active tickets', () => { + it('should receive an array of last active tickets of Bruce Wayne', async() => { + const ticketId = 22; + const clientId = 109; + const warehouseId = 5; + const result = await app.models.Client.lastActiveTickets(clientId, ticketId, warehouseId); + + const length = result.length; + const anyResult = result[Math.floor(Math.random() * Math.floor(length))]; + + const properties = Object.keys(anyResult); + + expect(properties.length).toEqual(9); + expect(result.length).toEqual(3); + }); +});