fix(updateClaim): el spec daba error refs #5979
This commit is contained in:
parent
d3a7b4ecb9
commit
07fa011035
|
@ -62,7 +62,7 @@ describe('Update Claim', () => {
|
|||
expect(error.message).toEqual(`You don't have enough privileges to change that field`);
|
||||
});
|
||||
|
||||
fit(`should success to update the claimState to 'canceled' and send a rocket message`, async() => {
|
||||
it(`should success to update the claimState to 'canceled' and send a rocket message`, async() => {
|
||||
const tx = await app.models.Claim.beginTransaction({});
|
||||
|
||||
try {
|
||||
|
|
|
@ -92,6 +92,7 @@ module.exports = Self => {
|
|||
// When hasToPickUp has been changed
|
||||
if (salesPerson && changedHasToPickUp && updatedClaim.hasToPickUp)
|
||||
notifyPickUp(ctx, salesPerson.id, claim);
|
||||
|
||||
// When claimState has been changed
|
||||
if (args.claimStateFk) {
|
||||
const newState = await models.ClaimState.findById(args.claimStateFk, null, myOptions);
|
||||
|
@ -114,7 +115,7 @@ module.exports = Self => {
|
|||
|
||||
async function notifyStateChange(ctx, workerId, claim, state) {
|
||||
const models = Self.app.models;
|
||||
const url = await models.Url.getUrl();
|
||||
const url = models.Url.getUrl();
|
||||
const $t = ctx.req.__; // $translate
|
||||
|
||||
const message = $t(`Claim state has changed to ${state}`, {
|
||||
|
@ -127,7 +128,7 @@ module.exports = Self => {
|
|||
|
||||
async function notifyPickUp(ctx, workerId, claim) {
|
||||
const models = Self.app.models;
|
||||
const url = await models.Url.getUrl('lilium');
|
||||
const url = models.Url.getUrl();
|
||||
const $t = ctx.req.__; // $translate
|
||||
|
||||
const message = $t('Claim will be picked', {
|
||||
|
|
Loading…
Reference in New Issue