diff --git a/test/regression/importer/importer_spec.js b/test/regression/importer/importer_spec.js index 29ed2f4ae1..721be9387f 100644 --- a/test/regression/importer/importer_spec.js +++ b/test/regression/importer/importer_spec.js @@ -21,96 +21,7 @@ const importOptions = { const knex = db.knex; -const exportedLatestBody = () => { - return _.clone({ - db: [{ - meta: { - exported_on: 1504269105806, - version: '2.0.0' - }, - data: { - app_fields: [], - app_settings: [], - apps: [], - brute: [], - invites: [], - migrations: [], - permissions: [], - permissions_roles: [], - permissions_users: [], - posts: [], - posts_tags: [], - posts_authors: [], - roles: [], - roles_users: [], - settings: [], - subscribers: [], - tags: [], - users: [] - } - }] - }); -}; - -const exportedPreviousBody = () => { - return _.clone({ - db: [{ - meta: { - exported_on: 1504269105806, - version: '1.20.0' - }, - data: { - app_fields: [], - app_settings: [], - apps: [], - brute: [], - invites: [], - migrations: [], - permissions: [], - permissions_roles: [], - permissions_users: [], - posts: [], - posts_tags: [], - posts_authors: [], - roles: [], - roles_users: [], - settings: [], - subscribers: [], - tags: [], - users: [] - } - }] - }); -}; - -const exportedLegacyBody = () => { - return _.clone({ - db: [{ - meta: { - exported_on: 1504269105806, - version: '300' - }, - data: { - app_fields: [], - app_settings: [], - apps: [], - brute: [], - invites: [], - permissions: [], - permissions_roles: [], - permissions_users: [], - posts: [], - posts_tags: [], - roles: [], - roles_users: [], - settings: [], - subscribers: [], - tags: [], - users: [] - } - }] - }); -}; +const {exportedPreviousBody, exportedLegacyBody, exportedLatestBody} = require('./utils/fixtures'); // Tests in here do an import for each test describe('Integration: Importer', function () { diff --git a/test/regression/importer/utils/fixtures.js b/test/regression/importer/utils/fixtures.js new file mode 100644 index 0000000000..fe3bfc3b2d --- /dev/null +++ b/test/regression/importer/utils/fixtures.js @@ -0,0 +1,96 @@ +const _ = require('lodash'); + +const exportedLatestBody = () => { + return _.clone({ + db: [{ + meta: { + exported_on: 1504269105806, + version: '2.0.0' + }, + data: { + app_fields: [], + app_settings: [], + apps: [], + brute: [], + invites: [], + migrations: [], + permissions: [], + permissions_roles: [], + permissions_users: [], + posts: [], + posts_tags: [], + posts_authors: [], + roles: [], + roles_users: [], + settings: [], + subscribers: [], + tags: [], + users: [] + } + }] + }); +}; + +const exportedPreviousBody = () => { + return _.clone({ + db: [{ + meta: { + exported_on: 1504269105806, + version: '1.20.0' + }, + data: { + app_fields: [], + app_settings: [], + apps: [], + brute: [], + invites: [], + migrations: [], + permissions: [], + permissions_roles: [], + permissions_users: [], + posts: [], + posts_tags: [], + posts_authors: [], + roles: [], + roles_users: [], + settings: [], + subscribers: [], + tags: [], + users: [] + } + }] + }); +}; + +const exportedLegacyBody = () => { + return _.clone({ + db: [{ + meta: { + exported_on: 1504269105806, + version: '300' + }, + data: { + app_fields: [], + app_settings: [], + apps: [], + brute: [], + invites: [], + permissions: [], + permissions_roles: [], + permissions_users: [], + posts: [], + posts_tags: [], + roles: [], + roles_users: [], + settings: [], + subscribers: [], + tags: [], + users: [] + } + }] + }); +}; + +module.exports.exportedLatestBody = exportedLatestBody; +module.exports.exportedPreviousBody = exportedPreviousBody; +module.exports.exportedLegacyBody = exportedLegacyBody;