Ghost/test/integration/importer/legacy.test.js
Hannah Wolfe 79233b1181 Removed unnecessary load of settings
- seems to save about a second locally for me - I'll take it!
2021-11-19 10:47:21 +00:00

27 lines
859 B
JavaScript

const testUtils = require('../../utils');
const importer = require('../../../core/server/data/importer');
const dataImporter = importer.importers[1];
const {exportedBodyLegacy} = require('../../utils/fixtures/export/body-generator');
const importOptions = {
returnImportedData: true
};
describe('Importer Legacy', function () {
beforeEach(testUtils.teardownDb);
beforeEach(testUtils.setup('roles', 'owner'));
it('disallows importing Legacy imports', function () {
const exportData = exportedBodyLegacy().db[0];
return dataImporter.doImport(exportData, importOptions)
.then(function () {
'0'.should.eql(1, 'Legacy import should fail');
})
.catch(function (err) {
err.message.should.eql('Detected unsupported file structure.');
});
});
});