Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 8323a5a

Browse files
Goamandmo-odoo
authored andcommitted
[FIX] BasicEditor: Remove FontSizeInput from BasicEditor
When performing tests that click on an the editor that is created with the `BasicEditor`, we do not want the text input to appear in the toolbar as it can cause simulated click to break.
1 parent 0db35f0 commit 8323a5a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

packages/bundle-basic-editor/BasicEditor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ export class BasicEditor extends JWEditor {
149149
'PreButton',
150150
],
151151
],
152-
['FontSizeInput'],
153152
['BoldButton', 'ItalicButton', 'UnderlineButton', 'RemoveFormatButton'],
154153
['AlignLeftButton', 'AlignCenterButton', 'AlignRightButton', 'AlignJustifyButton'],
155154
['OrderedListButton', 'UnorderedListButton', 'ChecklistButton'],

packages/plugin-dom-layout/test/DomLayout.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,7 @@ describe('DomLayout', () => {
24682468
rendered && 'children' in rendered && rendered.children,
24692469
).to.deep.equal(textNodes);
24702470

2471-
expect(mutationNumber).to.equal(6, 'add <b>, move <i>, 3 toolbar update');
2471+
expect(mutationNumber).to.equal(5, 'add <b>, move <i>, 3 toolbar update');
24722472

24732473
const renderedText1 = await renderer.render('dom/object', textNodes[1]);
24742474
expect(renderedText1).to.deep.equal({
@@ -2498,7 +2498,7 @@ describe('DomLayout', () => {
24982498
'<div>b</div>',
24992499
);
25002500
expect(mutationNumber).to.equal(
2501-
4,
2501+
2,
25022502
'update text, update toolbar history button',
25032503
);
25042504
},
@@ -2513,7 +2513,7 @@ describe('DomLayout', () => {
25132513
await editor.execCommand('deleteForward');
25142514
expect(document.querySelector('jw-test').innerHTML).to.equal('<p>abc</p>');
25152515
expect(mutationNumber).to.equal(
2516-
4,
2516+
3,
25172517
'remove <p>, remove <br>, update toolbar history button',
25182518
);
25192519
},
@@ -2530,7 +2530,7 @@ describe('DomLayout', () => {
25302530
'<p>a<span style="background-color: red;">bc</span>d</p>',
25312531
);
25322532
expect(mutationNumber).to.equal(
2533-
7,
2533+
6,
25342534
'update text, add <span>, add text, add text, 2 update toolbar',
25352535
);
25362536
mutationNumber = 0;
@@ -2556,7 +2556,7 @@ describe('DomLayout', () => {
25562556
'<p>a<span>b</span>c<span style="color: green;">d</span>e</p>',
25572557
);
25582558
expect(mutationNumber).to.equal(
2559-
7,
2559+
6,
25602560
'remove 3 formats + remove 2 empty styles, update toolbar',
25612561
);
25622562
},
@@ -2584,7 +2584,7 @@ describe('DomLayout', () => {
25842584
children: [{ tag: 'BR' }],
25852585
});
25862586
expect(mutationNumber).to.equal(
2587-
4,
2587+
3,
25882588
'add b, move br, update toolbar history button',
25892589
);
25902590
},
@@ -2614,7 +2614,7 @@ describe('DomLayout', () => {
26142614
children: [{ tag: 'BR' }],
26152615
});
26162616
expect(mutationNumber).to.equal(
2617-
4,
2617+
3,
26182618
'remove br, add b, update toolbar history button',
26192619
);
26202620

@@ -2664,7 +2664,7 @@ describe('DomLayout', () => {
26642664
children: [{ tag: 'BR' }],
26652665
});
26662666
expect(mutationNumber).to.equal(
2667-
12,
2667+
11,
26682668
'change text, add b, crete text, add text, move br, create text, add text, change text, 3 toolbar changes',
26692669
);
26702670
},
@@ -2695,7 +2695,7 @@ describe('DomLayout', () => {
26952695
children: [{ tag: 'BR' }],
26962696
});
26972697
expect(mutationNumber).to.equal(
2698-
7,
2698+
6,
26992699
'remove second b, move br, move text, update toolbar history button',
27002700
);
27012701
},

0 commit comments

Comments
 (0)