salix/modules/worker/back/methods/department/specs/createChild.spec.js

18 lines
494 B
JavaScript

const app = require('vn-loopback/server/server');
describe('department createChild()', () => {
let createdChild;
afterAll(async() => {
await createdChild.destroy();
});
it('should create a new child', async() => {
const parentId = null;
createdChild = await app.models.Department.createChild(parentId, 'My new department');
expect(createdChild.name).toEqual('My new department');
expect(createdChild.parentFk).toBeNull();
});
});