mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Updated importer test to use new object return format
no issue
This commit is contained in:
parent
56a6b5702a
commit
fc291240d5
2 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue