Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong committed Mar 29, 2024
1 parent 6994414 commit 88df7a4
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions packages/roosterjs-content-model-core/test/editor/EditorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as domToContentModel from 'roosterjs-content-model-dom/lib/domToModel/d
import * as transformColor from 'roosterjs-content-model-dom/lib/domUtils/style/transformColor';
import { ChangeSource, tableProcessor } from 'roosterjs-content-model-dom';
import { Editor } from '../../lib/editor/Editor';
import { expectHtml } from 'roosterjs-content-model-dom/test/testUtils';
import {
CachedElementHandler,
ContentModelDocument,
Expand Down Expand Up @@ -331,9 +332,11 @@ describe('Editor', () => {
},
},
});
expect(div.innerHTML).toBe(
'<div class="_Entity _EType_A _EId_B _EReadonly_1" contenteditable="false" style="color: var(--darkColor_red, red);"></div>'
);

expectHtml(div.innerHTML, [
'<div class="_Entity _EType_A _EId_B _EReadonly_1" contenteditable="false" style="color: var(--darkColor_red, red);"></div>',
'<div style="color: var(--darkColor_red, red);" class="_Entity _EType_A _EId_B _EReadonly_1" contenteditable="false"></div>',
]);

const model = editor.getContentModelCopy('clean');

Expand All @@ -355,12 +358,14 @@ describe('Editor', () => {
],
format: {},
});
expect((model.blocks[0] as ContentModelEntity).wrapper.outerHTML).toBe(
'<div class="_Entity _EType_A _EId_B _EReadonly_1" contenteditable="false" style="color: red; background-color: inherit;"></div>'
);
expect(div.innerHTML).toBe(
'<div class="_Entity _EType_A _EId_B _EReadonly_1" contenteditable="false" style="color: var(--darkColor_red, red);"></div>'
);
expectHtml((model.blocks[0] as ContentModelEntity).wrapper.outerHTML, [
'<div class="_Entity _EType_A _EId_B _EReadonly_1" contenteditable="false" style="color: red; background-color: inherit;"></div>',
'<div style="color: red; background-color: inherit;" class="_Entity _EType_A _EId_B _EReadonly_1" contenteditable="false"></div>',
]);
expectHtml(div.innerHTML, [
'<div class="_Entity _EType_A _EId_B _EReadonly_1" contenteditable="false" style="color: var(--darkColor_red, red);"></div>',
'<div style="color: var(--darkColor_red, red);" class="_Entity _EType_A _EId_B _EReadonly_1" contenteditable="false"></div>',
]);
});

it('getEnvironment', () => {
Expand Down

0 comments on commit 88df7a4

Please sign in to comment.