fix(clone): invoiceIn clone now adds (2) to the ref
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
c7558dfb0b
commit
471da0f4da
|
@ -1,8 +1,7 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
// #3082 clone is broken due to a strange trigger from production
|
||||
xdescribe('InvoiceIn descriptor path', () => {
|
||||
describe('InvoiceIn descriptor path', () => {
|
||||
let browser;
|
||||
let page;
|
||||
|
||||
|
|
|
@ -52,10 +52,11 @@ module.exports = Self => {
|
|||
|
||||
const issued = new Date(sourceInvoiceIn.issued);
|
||||
issued.setMonth(issued.getMonth() + 1);
|
||||
const clonedRef = sourceInvoiceIn.supplierRef + '(2)';
|
||||
|
||||
const clone = await models.InvoiceIn.create({
|
||||
serial: sourceInvoiceIn.serial,
|
||||
supplierRef: sourceInvoiceIn.supplierRef,
|
||||
supplierRef: clonedRef,
|
||||
supplierFk: sourceInvoiceIn.supplierFk,
|
||||
issued: issued,
|
||||
currencyFk: sourceInvoiceIn.currencyFk,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
// #3082 clone is broken due to a strange trigger from production
|
||||
xdescribe('invoiceIn clone()', () => {
|
||||
describe('invoiceIn clone()', () => {
|
||||
it('should return the cloned invoiceIn and also clone invoiceInDueDays and invoiceInTaxes if there are any referencing the invoiceIn', async() => {
|
||||
const userId = 1;
|
||||
const ctx = {
|
||||
|
@ -18,7 +17,7 @@ xdescribe('invoiceIn clone()', () => {
|
|||
try {
|
||||
const clone = await models.InvoiceIn.clone(ctx, 1, options);
|
||||
|
||||
expect(clone.supplierRef).toEqual('1234');
|
||||
expect(clone.supplierRef).toEqual('1234(2)');
|
||||
|
||||
const invoiceInTaxes = await models.InvoiceInTax.find({where: {invoiceInFk: clone.id}}, options);
|
||||
|
||||
|
|
Loading…
Reference in New Issue