Fixed test and DB structure
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
a204c6e2b0
commit
470b4485d5
|
@ -1 +0,0 @@
|
|||
ALTER TABLE vn.supplier MODIFY COLUMN supplierActivityFk varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL NULL;
|
|
@ -1 +1 @@
|
|||
ALTER TABLE vn.supplier MODIFY COLUMN supplierActivityFk varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 'flowersPlants' NULL;
|
||||
ALTER TABLE vn.supplier MODIFY COLUMN supplierActivityFk varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL NULL;
|
||||
|
|
|
@ -41,6 +41,7 @@ module.exports = Self => {
|
|||
};
|
||||
} catch (e) {
|
||||
if (tx) await tx.rollback();
|
||||
return params;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('Supplier newSupplier()', () => {
|
||||
const newSupp = {
|
||||
name: 'TestSupplier-1'
|
||||
};
|
||||
const administrativeId = 5;
|
||||
|
||||
it('should create a new supplier containing only the name', async() => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: administrativeId},
|
||||
};
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
|
||||
let result = await app.models.Supplier.newSupplier(JSON.stringify(newSupp));
|
||||
|
||||
result = result.supplier;
|
||||
|
|
Loading…
Reference in New Issue