0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Extracted LTS spec out of importer test suite

refs https://github.com/TryGhost/Team/issues/555

- Follow up to previous commit. Read it for full context.
- This step splits existing importer test suite into separate files based on current "describe sections". This is done to get the test suite size to somewhat comprehensive shape
This commit is contained in:
Naz 2021-03-12 15:46:01 +13:00 committed by naz
parent 4f83716cfe
commit 0bc33d6816
2 changed files with 27 additions and 18 deletions

View file

@ -21,7 +21,7 @@ const importOptions = {
const knex = db.knex;
const {exportedPreviousBody, exportedLegacyBody, exportedLatestBody} = require('./utils/fixtures');
const {exportedPreviousBody, exportedLatestBody} = require('./utils/fixtures');
// Tests in here do an import for each test
describe('Integration: Importer', function () {
@ -1542,20 +1542,3 @@ describe('1.0', function () {
});
});
});
describe('LTS', function () {
beforeEach(testUtils.teardownDb);
beforeEach(testUtils.setup('roles', 'owner', 'settings'));
it('disallows importing LTS imports', function () {
const exportData = exportedLegacyBody().db[0];
return dataImporter.doImport(exportData, importOptions)
.then(function () {
'0'.should.eql(1, 'LTS import should fail');
})
.catch(function (err) {
err.message.should.eql('Detected unsupported file structure.');
});
});
});

View file

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