mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Updated importer test to use new object return format
no issue
This commit is contained in:
parent
56a6b5702a
commit
fc291240d5
@ -47,7 +47,7 @@ DataImporter = {
|
||||
doImport: async function doImport(importData, importOptions) {
|
||||
importOptions = importOptions || {};
|
||||
|
||||
if (importOptions.importTag) {
|
||||
if (importOptions.importTag && importData?.data?.posts) {
|
||||
const tagId = ObjectId().toHexString();
|
||||
if (!('tags' in importData.data)) {
|
||||
importData.data.tags = [];
|
||||
@ -60,7 +60,7 @@ DataImporter = {
|
||||
if (!('posts_tags' in importData.data)) {
|
||||
importData.data.posts_tags = [];
|
||||
}
|
||||
for (const post of importData.data.posts || []) {
|
||||
for (const post of importData.data.posts) {
|
||||
if (!('id' in post)) {
|
||||
// Make sure post has an id if it doesn't already
|
||||
post.id = ObjectId().toHexString();
|
||||
|
@ -401,7 +401,7 @@ describe('Importer', function () {
|
||||
imageSpy.getCall(0).args[0].should.eql(expectedImages);
|
||||
|
||||
// we stubbed this as a noop but ImportManager calls with sequence, so we should get an array
|
||||
output.should.eql([expectedImages, expectedData]);
|
||||
output.should.eql({images: expectedImages, data: expectedData});
|
||||
done();
|
||||
}).catch(done);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user