2019-10-17 11:27:50 +00:00
|
|
|
const app = require('vn-loopback/server/server');
|
|
|
|
|
|
|
|
describe('department createChild()', () => {
|
|
|
|
let createdChild;
|
|
|
|
|
2021-10-15 12:45:41 +00:00
|
|
|
afterAll(async() => {
|
2019-10-17 11:27:50 +00:00
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|