2020-02-28 00:27:39 +01:00
|
|
|
const bootstrap = require('../../config/functions/bootstrap');
|
2020-02-26 18:34:45 +01:00
|
|
|
|
|
|
|
describe('Upload plugin bootstrap function', () => {
|
|
|
|
test('Sets default config if id does not exist', async () => {
|
|
|
|
const setStore = jest.fn(() => {});
|
|
|
|
|
2020-02-28 09:06:26 +01:00
|
|
|
global.strapi = {
|
2020-02-26 18:34:45 +01:00
|
|
|
config: {
|
|
|
|
info: {
|
|
|
|
dependencies: {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: {
|
|
|
|
upload: { config: {} },
|
|
|
|
},
|
|
|
|
store() {
|
|
|
|
return {
|
|
|
|
get() {
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
set: setStore,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2020-02-28 09:06:26 +01:00
|
|
|
await bootstrap();
|
2020-02-26 18:34:45 +01:00
|
|
|
|
|
|
|
expect(setStore).toHaveBeenCalledWith({
|
|
|
|
value: {
|
|
|
|
sizeOptimization: true,
|
|
|
|
videoPreview: true,
|
|
|
|
responsiveDimensions: true,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|