mirror of
https://github.com/strapi/strapi.git
synced 2025-08-10 17:58:07 +00:00
test(entity-service)
This commit is contained in:
parent
aac731d7a0
commit
61a474c0b4
@ -20,6 +20,12 @@ describe('Entity service', () => {
|
|||||||
query: jest.fn(() => ({})),
|
query: jest.fn(() => ({})),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
global.strapi.webhookStore = {
|
||||||
|
allowedEvents: new Map([['ENTRY_CREATE', 'entry.create']]),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
describe('Decorator', () => {
|
describe('Decorator', () => {
|
||||||
test.each(['create', 'update', 'findMany', 'findOne', 'delete', 'count', 'findPage'])(
|
test.each(['create', 'update', 'findMany', 'findOne', 'delete', 'count', 'findPage'])(
|
||||||
'Can decorate',
|
'Can decorate',
|
||||||
@ -98,12 +104,15 @@ describe('Entity service', () => {
|
|||||||
global.strapi.getModel.mockImplementation((modelName) => fakeModels[modelName]);
|
global.strapi.getModel.mockImplementation((modelName) => fakeModels[modelName]);
|
||||||
global.strapi.query.mockImplementation(() => fakeQuery);
|
global.strapi.query.mockImplementation(() => fakeQuery);
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
global.strapi.getModel.mockImplementation(() => ({}));
|
global.strapi.getModel.mockImplementation(() => ({}));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('assign default values', () => {
|
describe('assign default values', () => {
|
||||||
let instance;
|
let instance;
|
||||||
const entityUID = 'api::entity.entity';
|
const entityUID = 'api::entity.entity';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user