mirror of
https://github.com/strapi/strapi.git
synced 2025-09-22 06:50:51 +00:00
fix entity service webhook test
This commit is contained in:
parent
84352c1e88
commit
c396c899b7
@ -16,27 +16,33 @@ describe('Entity service triggers webhooks', () => {
|
||||
let entity = { attr: 'value' };
|
||||
|
||||
beforeAll(() => {
|
||||
const fakeDB = {
|
||||
count: () => 0,
|
||||
create: ({ data }) => data,
|
||||
update: ({ data }) => data,
|
||||
findOne: () => entity,
|
||||
findMany: () => [entity, entity],
|
||||
delete: () => ({}),
|
||||
deleteMany: () => ({}),
|
||||
load: () => ({}),
|
||||
};
|
||||
|
||||
global.strapi = {
|
||||
getModel: () => ({
|
||||
kind: 'singleType',
|
||||
modelName: 'test-model',
|
||||
privateAttributes: [],
|
||||
attributes: {
|
||||
attr: { type: 'string' },
|
||||
},
|
||||
}),
|
||||
query: () => fakeDB,
|
||||
};
|
||||
|
||||
instance = createEntityService({
|
||||
strapi: {
|
||||
getModel: () => ({
|
||||
kind: 'singleType',
|
||||
modelName: 'test-model',
|
||||
privateAttributes: [],
|
||||
attributes: {
|
||||
attr: { type: 'string' },
|
||||
},
|
||||
}),
|
||||
},
|
||||
strapi: global.strapi,
|
||||
db: {
|
||||
query: () => ({
|
||||
count: () => 0,
|
||||
create: ({ data }) => data,
|
||||
update: ({ data }) => data,
|
||||
findOne: () => entity,
|
||||
findMany: () => [entity, entity],
|
||||
delete: () => ({}),
|
||||
deleteMany: () => ({}),
|
||||
}),
|
||||
query: () => fakeDB,
|
||||
},
|
||||
eventHub,
|
||||
entityValidator,
|
||||
|
Loading…
x
Reference in New Issue
Block a user