7152-devToTest_2414 #2228

Merged
alexm merged 636 commits from 7152-devToTest_2414 into test 2024-03-28 08:26:34 +00:00
2 changed files with 6 additions and 4 deletions
Showing only changes of commit 39b1e9ff7b - Show all commits

View File

@ -19,7 +19,7 @@ module.exports = Self => {
}
});
Self.getUncheckedTicket = async(ticketFk, options) => {
Self.hasUncheckedTicket = async(ticketFk, options) => {
const myOptions = {};
if (typeof options == 'object')

View File

@ -2,7 +2,7 @@
const {models} = require('vn-loopback/server/server');
describe('ticketCollection hasUncheckedTicket()', () => {
fit('should return false because there are not tickets not checked', async() => {
it('should return false because there are not tickets not checked', async() => {
const ticketFk = 1;
const result = await models.TicketCollection.hasUncheckedTicket(ticketFk);
@ -11,17 +11,19 @@ describe('ticketCollection hasUncheckedTicket()', () => {
it('should return true because there is a ticket not checked', async() => {
const ticketFk = 1;
const stateFkCurrent = 16;
const stateFkUpdated = 7;
const tx = await models.TicketTracking.beginTransaction({});
const myOptions = {transaction: tx};
const filter = {where: {
ticketFk: 1,
stateFk: 16}
stateFk: stateFkCurrent}
};
try {
const ticketTracking = await models.TicketTracking.findOne(filter, myOptions);
await ticketTracking.updateAttributes({
stateFk: 7
stateFk: stateFkUpdated
});
const result = await models.TicketCollection.hasUncheckedTicket(ticketFk, myOptions);