0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/test/regression/importer/utils/fixtures.js
Naz 4f83716cfe Extracted importer test suite utils
refs https://github.com/TryGhost/Team/issues/555

- As part of testing upcoming 4.0 release was looking into a robust way to test imports. The importer test suite is humongous, so started with small extractions.
- The goal is to have readable and easy to create version-specific "exports" that would allow for more convenient testing
2021-03-23 00:42:22 +13:00

96 lines
2.5 KiB
JavaScript

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;