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