Skip to content

Commit

Permalink
Remove attributes in tests for versions of Mobiledoc < 0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
YoranBrondsema committed Jul 16, 2019
1 parent 08315f4 commit 690b84d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tests/helpers/create-mobiledoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,23 @@ export function createSimpleMobiledoc({sectionName='p', text='hello world', mark
let closedMarkups = markup ? 1 : 0;
let markups = markup ? [markup] : [];

let section = [
MARKUP_SECTION_TYPE,
sectionName,
[
[MARKUP_MARKER_TYPE, openedMarkups, closedMarkups, text]
]
];

if (version === MOBILEDOC_VERSION_0_3_2) {
section.push(objectToSortedKVArray(attributes));
}

return {
version,
atoms: [],
cards: [],
markups: markups,
sections: [
[MARKUP_SECTION_TYPE, sectionName, [
[MARKUP_MARKER_TYPE, openedMarkups, closedMarkups, text]
],
objectToSortedKVArray(attributes)
],
]
sections: [section]
};
}

0 comments on commit 690b84d

Please sign in to comment.