4270-route.create #1023
|
@ -4,7 +4,7 @@ describe('route updateWorkCenter()', () => {
|
||||||
const routeId = 1;
|
const routeId = 1;
|
||||||
|
|
||||||
it('should set the commission work center if the worker has workCenter', async() => {
|
it('should set the commission work center if the worker has workCenter', async() => {
|
||||||
const tx = await models.Defaulter.beginTransaction({});
|
const tx = await models.Route.beginTransaction({});
|
||||||
vicent marked this conversation as resolved
Outdated
|
|||||||
try {
|
try {
|
||||||
const developerId = 9;
|
const developerId = 9;
|
||||||
const ctx = {
|
const ctx = {
|
||||||
|
@ -26,13 +26,13 @@ describe('route updateWorkCenter()', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should set the commission work center equals default work center if the worker hasn't workCenter`, async() => {
|
it(`shoul set the default commision work center if that worker didn't have one yet`, async() => {
|
||||||
vicent marked this conversation as resolved
Outdated
carlosjr
commented
Shoul set the default commision work center if that worker didn't have one yet Shoul set the default commision work center if that worker didn't have one yet
|
|||||||
const tx = await models.Defaulter.beginTransaction({});
|
const tx = await models.Route.beginTransaction({});
|
||||||
try {
|
try {
|
||||||
const noExistentId = 2;
|
const userWithoutWorkCenter = 2;
|
||||||
vicent marked this conversation as resolved
Outdated
carlosjr
commented
¿Te refieres a el user "Customer" no tiene workCenter asignado? esta variable es confusa, dale un nombre que describa realmente lo que hace. ¿Te refieres a el user "Customer" no tiene workCenter asignado? esta variable es confusa, dale un nombre que describa realmente lo que hace.
|
|||||||
const ctx = {
|
const ctx = {
|
||||||
req: {
|
req: {
|
||||||
accessToken: {userId: noExistentId}
|
accessToken: {userId: userWithoutWorkCenter}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
Loading…
Reference in New Issue
Es confuso iniciar la transacción en un modelo que no es el que vas a invocar en tu funcionalidad.
models.Defaulter vs models.Route