Skip to content

Commit

Permalink
refactor: use string comparisions
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesRijckaert committed Jul 27, 2023
1 parent edc41a4 commit 47ff732
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 211 deletions.
2 changes: 2 additions & 0 deletions cypress/e2e/rich-text/RichTextEditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ describe('Rich Text Editor', { viewportHeight: 2000 }, () => {
richText.editor.type('end');

richText.expectValue(normalizationWithoutValueChange);

richText.expectNoValidationErrors();
});
});

Expand Down
90 changes: 35 additions & 55 deletions cypress/e2e/rich-text/document-mocks/newLineEntityBlockListItem.js
Original file line number Diff line number Diff line change
@@ -1,86 +1,66 @@
export default {
nodeType: 'document',
data: {},
content: [
{
nodeType: 'unordered-list',
data: {},
content: [
{
nodeType: 'list-item',
data: {},
content: [
{
nodeType: 'paragraph',
data: {},
marks: [],
nodeType: 'text',
value: 'some text 1',
content: [{ nodeType: 'text', value: 'some text 1', marks: [], data: {} }],
},
],
data: {},
nodeType: 'paragraph',
},
{
content: [],
data: {
target: {
sys: {
id: 'example-entity-id',
linkType: 'Entry',
type: 'Link',
},
},
},
nodeType: 'embedded-entry-block',
},
{
nodeType: 'list-item',
data: {},
content: [
{
data: {},
marks: [],
nodeType: 'text',
value: 'some more text',
},
],
data: {},
nodeType: 'paragraph',
},
{
content: [],
data: {
target: {
sys: {
id: 'example-entity-id',
linkType: 'Entry',
type: 'Link',
nodeType: 'embedded-entry-block',
data: {
target: { sys: { id: 'example-entity-id', type: 'Link', linkType: 'Entry' } },
},
content: [],
},
},
nodeType: 'embedded-entry-block',
},
{
content: [
{
nodeType: 'paragraph',
data: {},
marks: [],
nodeType: 'text',
value: '',
content: [{ nodeType: 'text', value: '', marks: [], data: {} }],
},
],
data: {},
nodeType: 'paragraph',
},
],
},
{
nodeType: 'paragraph',
data: {},
nodeType: 'unordered-list',
content: [{ nodeType: 'text', value: '', marks: [], data: {} }],
},
{
content: [
{
data: {},
marks: [],
nodeType: 'text',
value: '',
},
],
nodeType: 'paragraph',
data: {},
content: [{ nodeType: 'text', value: 'some more text', marks: [], data: {} }],
},
{
nodeType: 'embedded-entry-block',
data: { target: { sys: { id: 'example-entity-id', type: 'Link', linkType: 'Entry' } } },
content: [],
},
{
nodeType: 'paragraph',
data: {},
content: [{ nodeType: 'text', value: '', marks: [], data: {} }],
},
{
nodeType: 'paragraph',
data: {},
content: [{ nodeType: 'text', value: '', marks: [], data: {} }],
},
],
data: {},
};
Loading

0 comments on commit 47ff732

Please sign in to comment.