Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaroldi committed Oct 28, 2024
1 parent eaf810b commit de360a8
Showing 1 changed file with 50 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1044,12 +1044,17 @@ describe('Content Model Auto Format Plugin Test', () => {

const segment: ContentModelText = {
segmentType: 'Text',
text: 'test--test',
text: 'test--test ',
format: {},
};
const selectionMarker: ContentModelSelectionMarker = {
segmentType: 'SelectionMarker',
format: {},
isSelected: true,
};
const paragraph: ContentModelParagraph = {
blockType: 'Paragraph',
segments: [segment],
segments: [segment, selectionMarker],
format: {},
};
const model: ContentModelDocument = {
Expand Down Expand Up @@ -1077,7 +1082,7 @@ describe('Content Model Auto Format Plugin Test', () => {
expect(model).toEqual(expectedResult);
}

xit('should call transformHyphen', () => {
it('should call transformHyphen', () => {
const event: EditorInputEvent = {
eventType: 'input',
rawEvent: { data: ' ', preventDefault: () => {}, inputType: 'insertText' } as any,
Expand All @@ -1096,6 +1101,17 @@ describe('Content Model Auto Format Plugin Test', () => {
format: {},
isSelected: undefined,
},
{
segmentType: 'Text',
text: ' ',
format: {},
isSelected: undefined,
},
{
segmentType: 'SelectionMarker',
format: {},
isSelected: true,
},
],
format: {},
},
Expand Down Expand Up @@ -1123,8 +1139,13 @@ describe('Content Model Auto Format Plugin Test', () => {
segments: [
{
segmentType: 'Text',
text: 'test--test',
text: 'test--test ',
format: {},
},
{
segmentType: 'SelectionMarker',
format: {},
isSelected: true,
},
],
format: {},
Expand Down Expand Up @@ -1157,9 +1178,14 @@ describe('Content Model Auto Format Plugin Test', () => {
segments: [
{
segmentType: 'Text',
text: 'test--test',
text: 'test--test ',
format: {},
},
{
segmentType: 'SelectionMarker',
format: {},
isSelected: true,
},
],
format: {},
},
Expand All @@ -1185,7 +1211,7 @@ describe('Content Model Auto Format Plugin Test', () => {

const segment: ContentModelText = {
segmentType: 'Text',
text: '1/2',
text: '1/2 ',
format: {},
};
const paragraph: ContentModelParagraph = {
Expand Down Expand Up @@ -1218,7 +1244,7 @@ describe('Content Model Auto Format Plugin Test', () => {
expect(model).toEqual(expectResult);
}

xit('should call transformFraction', () => {
it('should call transformFraction', () => {
const event: EditorInputEvent = {
eventType: 'input',
rawEvent: { data: ' ', preventDefault: () => {}, inputType: 'insertText' } as any,
Expand All @@ -1238,6 +1264,12 @@ describe('Content Model Auto Format Plugin Test', () => {
format: {},
isSelected: undefined,
},
{
segmentType: 'Text',
text: ' ',
format: {},
isSelected: undefined,
},
],
},
],
Expand All @@ -1249,7 +1281,7 @@ describe('Content Model Auto Format Plugin Test', () => {
);
});

it('should not call transformHyphen - disable options', () => {
it('should not call transformFraction - disable options', () => {
const event: EditorInputEvent = {
eventType: 'input',
rawEvent: { data: ' ', preventDefault: () => {}, inputType: 'insertText' } as any,
Expand All @@ -1262,7 +1294,7 @@ describe('Content Model Auto Format Plugin Test', () => {
{
blockType: 'Paragraph',
format: {},
segments: [{ segmentType: 'Text', text: '1/2', format: {} }],
segments: [{ segmentType: 'Text', text: '1/2 ', format: {} }],
},
],
},
Expand All @@ -1286,7 +1318,7 @@ describe('Content Model Auto Format Plugin Test', () => {

const segment: ContentModelText = {
segmentType: 'Text',
text: '1st',
text: '1st ',
format: {},
};
const paragraph: ContentModelParagraph = {
Expand Down Expand Up @@ -1319,7 +1351,7 @@ describe('Content Model Auto Format Plugin Test', () => {
expect(model).toEqual(expectResult);
}

xit('should call transformOrdinals', () => {
it('should call transformOrdinals', () => {
const event: EditorInputEvent = {
eventType: 'input',
rawEvent: { data: ' ', preventDefault: () => {}, inputType: 'insertText' } as any,
Expand All @@ -1345,6 +1377,12 @@ describe('Content Model Auto Format Plugin Test', () => {
format: { superOrSubScriptSequence: 'super' },
isSelected: undefined,
},
{
segmentType: 'Text',
text: ' ',
format: {},
isSelected: undefined,
},
],
},
],
Expand All @@ -1369,7 +1407,7 @@ describe('Content Model Auto Format Plugin Test', () => {
{
blockType: 'Paragraph',
format: {},
segments: [{ segmentType: 'Text', text: '1st', format: {} }],
segments: [{ segmentType: 'Text', text: '1st ', format: {} }],
},
],
},
Expand Down

0 comments on commit de360a8

Please sign in to comment.