mirror of
https://github.com/strapi/strapi.git
synced 2025-12-24 05:34:33 +00:00
remove migration tests
This commit is contained in:
parent
70d1b600d5
commit
838f7f13d2
@ -1,35 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const { disableOnContentTypes } = require('../review-workflows');
|
||||
|
||||
describe('disableOnContentTypes', () => {
|
||||
test('correctly identifies the content types that have had review workflows disabled', async () => {
|
||||
const delSpy = jest.fn();
|
||||
const whereInSpy = jest.fn(() => ({ del: delSpy }));
|
||||
|
||||
global.strapi = {
|
||||
db: {
|
||||
connection: () => ({ whereIn: whereInSpy }),
|
||||
},
|
||||
};
|
||||
|
||||
const baseOptions = { options: { reviewWorkflows: false } };
|
||||
const contentTypes = Object.fromEntries([
|
||||
['U1', baseOptions],
|
||||
['U2', baseOptions],
|
||||
['U3', baseOptions],
|
||||
]);
|
||||
const oldContentTypes = Object.fromEntries([
|
||||
['U1', { options: { reviewWorkflows: true } }],
|
||||
['U2', baseOptions],
|
||||
['U3', { options: { reviewWorkflows: true } }],
|
||||
['U4', { options: { reviewWorkflows: true } }],
|
||||
]);
|
||||
|
||||
await disableOnContentTypes({ oldContentTypes, contentTypes });
|
||||
|
||||
expect(whereInSpy).toHaveBeenCalledTimes(1);
|
||||
expect(whereInSpy).toHaveBeenCalledWith('related_type', ['U1', 'U3']);
|
||||
expect(delSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user