Skip to content

Commit cbde79b

Browse files
TINYINT-3431: Prepare for 2.3 release (#31)
* TINYINT-3431: Prepare for 2.3 release * Try to fix flake test * Another attempt to fix flaky tests * Use the correct option for loading tinymce locally * Remove await * Fix lint * Update more tests to use local tinymce * Skip most tests * Configure chrome + lambdatest pipeline * Unskip tests
1 parent 2c93996 commit cbde79b

9 files changed

Lines changed: 151 additions & 36 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## 2.3.0 - 2026-05-28
10+
911
### Changed
1012

1113
- Updated to support jQuery 4. #INT-3359

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ mixedBeehiveFlow(
1212
],
1313
testPrefix: 'Tiny-jQuery',
1414
platforms: [
15-
[ browser: 'chrome', headless: true ],
15+
[ browser: 'chrome', provider: 'lambdatest', os: 'macOS Sonoma', buckets: 1 ],
1616
[ browser: 'firefox', provider: 'aws', buckets: 1 ],
1717
[ browser: 'safari', provider: 'lambdatest', os: 'macOS Sonoma', buckets: 1 ]
1818
],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tinymce/tinymce-jquery",
3-
"version": "2.3.0-rc",
3+
"version": "2.3.0",
44
"description": "Official TinyMCE integration for jQuery",
55
"main": "dist/tinymce-jquery.js",
66
"files": [

src/test/ts/Utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ export const createEditor = async (action: (targetElm: JQuery<HTMLElement>, edit
1212
const targetElm = $(ce.dom);
1313
const editors = await targetElm.tinymce({
1414
license_key: 'gpl',
15-
base_url: '/project/node_modules/tinymce',
15+
script_url: '/project/node_modules/tinymce/tinymce.js',
1616
});
17-
await Waiter.pTryUntil('Editor should be initialized', () => editors[0]?.initialized);
17+
18+
await Waiter.pTryUntilPredicate('Editor should be initialized', () => editors[0]?.initialized === true);
19+
1820
try {
1921
const maybeAsync = action(targetElm, editors[0]);
2022
if (maybeAsync) {

src/test/ts/browser/JqEmptyTest.ts

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ describe('Check jQuery\'s `.empty()` function', () => {
3636
it('check empty works on a inline editor with content', async () => {
3737
await createHTML(`<section><div id="editor"><p>Hello</p><p>World</p></div></section>`, async (root) => {
3838
const elm = $('div#editor');
39-
const ed = (await elm.tinymce({ inline: true }))[0];
39+
const ed = (await elm.tinymce({
40+
license_key: 'gpl',
41+
script_url: '/project/node_modules/tinymce/tinymce.js',
42+
inline: true
43+
}))[0];
4044
try {
4145
Assertions.assertEq('Expected editor to have content', `<p>Hello</p>\n<p>World</p>`, ed.getContent());
4246
elm.empty();
@@ -56,7 +60,10 @@ describe('Check jQuery\'s `.empty()` function', () => {
5660
// eslint-disable-next-line max-len
5761
await createHTML(`<section><div id="container"><p>Before</p><div><textarea id="editor">&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;World&lt;/p&gt;</textarea></div><p>After</p></div><p>Extra</p></section>`, async (root) => {
5862
const edElm = $('textarea#editor');
59-
const ed = (await edElm.tinymce({ }))[0];
63+
const ed = (await edElm.tinymce({
64+
license_key: 'gpl',
65+
script_url: '/project/node_modules/tinymce/tinymce.js',
66+
}))[0];
6067
try {
6168
Assertions.assertEq('Expected editor to have content', `<p>Hello</p>\n<p>World</p>`, ed.getContent());
6269
const container = $('div#container');
@@ -73,7 +80,11 @@ describe('Check jQuery\'s `.empty()` function', () => {
7380
// eslint-disable-next-line max-len
7481
await createHTML(`<section><div id="container"><p>Before</p><div><div id="editor"><p>Hello</p><p>World</p></div></div><p>After</p></div><p>Extra</p></section>`, async (root) => {
7582
const edElm = $('div#editor');
76-
const ed = (await edElm.tinymce({ inline: true }))[0];
83+
const ed = (await edElm.tinymce({
84+
license_key: 'gpl',
85+
script_url: '/project/node_modules/tinymce/tinymce.js',
86+
inline: true
87+
}))[0];
7788
try {
7889
Assertions.assertEq('Expected editor to have content', `<p>Hello</p>\n<p>World</p>`, ed.getContent());
7990
const container = $('div#container');
@@ -113,8 +124,15 @@ describe('Check jQuery\'s `.empty()` function', () => {
113124
const normal = $('textarea.editor');
114125
const eds: Editor[] = [];
115126
try {
116-
eds.push(...await inline.tinymce({ inline: true }));
117-
eds.push(...await normal.tinymce({ }));
127+
eds.push(...await inline.tinymce({
128+
license_key: 'gpl',
129+
script_url: '/project/node_modules/tinymce/tinymce.js',
130+
inline: true
131+
}));
132+
eds.push(...await normal.tinymce({
133+
license_key: 'gpl',
134+
script_url: '/project/node_modules/tinymce/tinymce.js'
135+
}));
118136
for (let i = 0; i < eds.length; i++) {
119137
Assertions.assertEq(`Expected editor ${i} to have content`, `<p>Content1</p>\n<p>Content2</p>`, eds[i].getContent());
120138
}
@@ -139,7 +157,10 @@ describe('Check jQuery\'s `.empty()` function', () => {
139157
it('check normal editors before and after are left alone', async () => {
140158
// eslint-disable-next-line max-len
141159
await createHTML(`<section><textarea class="editor">&lt;p&gt;Editor Content&lt;/p&gt;</textarea><div id="container"><p>Container Content</p></div><textarea class="editor">&lt;p&gt;Editor Content&lt;/p&gt;</textarea></section>`, async () => {
142-
const eds = await $('textarea.editor').tinymce({ });
160+
const eds = await $('textarea.editor').tinymce({
161+
license_key: 'gpl',
162+
script_url: '/project/node_modules/tinymce/tinymce.js',
163+
});
143164
try {
144165
for (let i = 0; i < eds.length; i++) {
145166
Assertions.assertEq(`Expected editor ${i} to have content`, `<p>Editor Content</p>`, eds[i].getContent());
@@ -162,7 +183,11 @@ describe('Check jQuery\'s `.empty()` function', () => {
162183
it('check inline editors before and after are left alone', async () => {
163184
// eslint-disable-next-line max-len
164185
await createHTML(`<section><div class="editor"><p>Editor Content</p></div><div id="container"><p>Container Content</p></div><div class="editor"><p>Editor Content</p></div></section>`, async () => {
165-
const eds = await $('div.editor').tinymce({ inline: true });
186+
const eds = await $('div.editor').tinymce({
187+
license_key: 'gpl',
188+
script_url: '/project/node_modules/tinymce/tinymce.js',
189+
inline: true
190+
});
166191
try {
167192
for (let i = 0; i < eds.length; i++) {
168193
Assertions.assertEq(`Expected editor ${i} to have content`, `<p>Editor Content</p>`, eds[i].getContent());

src/test/ts/browser/JqRemoveTest.ts

Lines changed: 79 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ describe('Check jQuery\'s `.remove()` function', () => {
3636
await createHTML(`<section><div id="target"><p>Before</p><textarea id="editor">&lt;p&gt;Content&lt;/p&gt;</textarea></div></section>`, async (root) => {
3737
const target = $('div#target');
3838
const elm = $('textarea#editor');
39-
const ed = (await elm.tinymce({ }))[0];
39+
const ed = (await elm.tinymce({
40+
license_key: 'gpl',
41+
script_url: '/project/node_modules/tinymce/tinymce.js',
42+
}))[0];
4043
try {
4144
Assertions.assertEq('Expected editor to contain content', `<p>Content</p>`, ed.getContent());
4245
target.remove();
@@ -51,7 +54,11 @@ describe('Check jQuery\'s `.remove()` function', () => {
5154
await createHTML(`<section><div id="target"><p>Before</p><div id="editor"><p>Content</p></div></div></section>`, async (root) => {
5255
const target = $('div#target');
5356
const elm = $('div#editor');
54-
const ed = (await elm.tinymce({ inline: true }))[0];
57+
const ed = (await elm.tinymce({
58+
license_key: 'gpl',
59+
script_url: '/project/node_modules/tinymce/tinymce.js',
60+
inline: true
61+
}))[0];
5562
try {
5663
Assertions.assertStructure('Expected root to initially contain everything',
5764
ApproxStructure.fromHtml(`<section><div id="target"><p>Before</p><div id="editor"><p>Content</p></div></div></section>`),
@@ -74,9 +81,18 @@ describe('Check jQuery\'s `.remove()` function', () => {
7481
const target = $('div.target');
7582
const eds: Editor[] = [];
7683
try {
77-
eds.push((await $('textarea#editor1').tinymce({ }))[0]);
78-
eds.push((await $('textarea#editor2').tinymce({ }))[0]);
79-
eds.push((await $('textarea#editor3').tinymce({ }))[0]);
84+
eds.push((await $('textarea#editor1').tinymce({
85+
license_key: 'gpl',
86+
script_url: '/project/node_modules/tinymce/tinymce.js'
87+
}))[0]);
88+
eds.push((await $('textarea#editor2').tinymce({
89+
license_key: 'gpl',
90+
script_url: '/project/node_modules/tinymce/tinymce.js'
91+
}))[0]);
92+
eds.push((await $('textarea#editor3').tinymce({
93+
license_key: 'gpl',
94+
script_url: '/project/node_modules/tinymce/tinymce.js'
95+
}))[0]);
8096
Assertions.assertEq('Expected editor 1 to contain content', `<p>Content</p>`, eds[0].getContent());
8197
Assertions.assertEq('Expected editor 2 to contain content', `<p>Content</p>`, eds[1].getContent());
8298
Assertions.assertEq('Expected editor 3 to contain content', `<p>Content</p>`, eds[2].getContent());
@@ -102,9 +118,21 @@ describe('Check jQuery\'s `.remove()` function', () => {
102118
const target = $('div.target');
103119
const eds: Editor[] = [];
104120
try {
105-
eds.push((await $('div#editor1').tinymce({ inline: true }))[0]);
106-
eds.push((await $('div#editor2').tinymce({ inline: true }))[0]);
107-
eds.push((await $('div#editor3').tinymce({ inline: true }))[0]);
121+
eds.push((await $('div#editor1').tinymce({
122+
license_key: 'gpl',
123+
script_url: '/project/node_modules/tinymce/tinymce.js',
124+
inline: true
125+
}))[0]);
126+
eds.push((await $('div#editor2').tinymce({
127+
license_key: 'gpl',
128+
script_url: '/project/node_modules/tinymce/tinymce.js',
129+
inline: true
130+
}))[0]);
131+
eds.push((await $('div#editor3').tinymce({
132+
license_key: 'gpl',
133+
script_url: '/project/node_modules/tinymce/tinymce.js',
134+
inline: true
135+
}))[0]);
108136
Assertions.assertStructure('Expected root to initially contain everything',
109137
ApproxStructure.fromHtml('<section>' +
110138
'<div class="target"><div id="editor1"><p>Content</p></div></div>' +
@@ -135,7 +163,10 @@ describe('Check jQuery\'s `.remove()` function', () => {
135163
it('check works without selector on normal editors', async () => {
136164
await createHTML(`<section><textarea id="editor">&lt;p&gt;Content&lt;/p&gt;</textarea></section>`, async (root) => {
137165
const elm = $('textarea#editor');
138-
const ed = (await elm.tinymce({ }))[0];
166+
const ed = (await elm.tinymce({
167+
license_key: 'gpl',
168+
script_url: '/project/node_modules/tinymce/tinymce.js'
169+
}))[0];
139170
try {
140171
Assertions.assertEq('Expected editor to contain content', `<p>Content</p>`, ed.getContent());
141172
elm.remove();
@@ -149,7 +180,11 @@ describe('Check jQuery\'s `.remove()` function', () => {
149180
it('check works without selector on inline editors', async () => {
150181
await createHTML(`<section><div id="editor"><p>Content</p></div></section>`, async (root) => {
151182
const elm = $('div#editor');
152-
const ed = (await elm.tinymce({ }))[0];
183+
const ed = (await elm.tinymce({
184+
license_key: 'gpl',
185+
script_url: '/project/node_modules/tinymce/tinymce.js',
186+
inline: true
187+
}))[0];
153188
try {
154189
Assertions.assertEq('Expected editor to contain content', `<p>Content</p>`, ed.getContent());
155190
elm.remove();
@@ -169,9 +204,18 @@ describe('Check jQuery\'s `.remove()` function', () => {
169204
const target = $('section.container textarea');
170205
const eds: Editor[] = [];
171206
try {
172-
eds.push((await $('textarea#editor1').tinymce({ }))[0]);
173-
eds.push((await $('textarea#editor2').tinymce({ }))[0]);
174-
eds.push((await $('textarea#editor3').tinymce({ }))[0]);
207+
eds.push((await $('textarea#editor1').tinymce({
208+
license_key: 'gpl',
209+
script_url: '/project/node_modules/tinymce/tinymce.js'
210+
}))[0]);
211+
eds.push((await $('textarea#editor2').tinymce({
212+
license_key: 'gpl',
213+
script_url: '/project/node_modules/tinymce/tinymce.js'
214+
}))[0]);
215+
eds.push((await $('textarea#editor3').tinymce({
216+
license_key: 'gpl',
217+
script_url: '/project/node_modules/tinymce/tinymce.js'
218+
}))[0]);
175219
Assertions.assertEq('Expected editor 1 to contain content', `<p>Content</p>`, eds[0].getContent());
176220
Assertions.assertEq('Expected editor 2 to contain content', `<p>Content</p>`, eds[1].getContent());
177221
Assertions.assertEq('Expected editor 3 to contain content', `<p>Content</p>`, eds[2].getContent());
@@ -197,9 +241,28 @@ describe('Check jQuery\'s `.remove()` function', () => {
197241
const target = $('section.container div');
198242
const eds: Editor[] = [];
199243
try {
200-
eds.push((await $('div#editor1').tinymce({ inline: true }))[0]);
201-
eds.push((await $('div#editor2').tinymce({ inline: true }))[0]);
202-
eds.push((await $('div#editor3').tinymce({ inline: true }))[0]);
244+
eds.push((await $('div#editor1').tinymce({
245+
license_key: 'gpl',
246+
script_url: '/project/node_modules/tinymce/tinymce.js',
247+
inline: true }))[0]);
248+
eds.push((await $('div#editor2').tinymce({
249+
license_key: 'gpl',
250+
script_url: '/project/node_modules/tinymce/tinymce.js',
251+
inline: true }))[0]);
252+
eds.push((await $('div#editor3').tinymce({
253+
license_key: 'gpl',
254+
script_url: '/project/node_modules/tinymce/tinymce.js',
255+
inline: true }))[0]);
256+
eds.push((await $('div#editor2').tinymce({
257+
license_key: 'gpl',
258+
script_url: '/project/node_modules/tinymce/tinymce.js',
259+
inline: true
260+
}))[0]);
261+
eds.push((await $('div#editor3').tinymce({
262+
license_key: 'gpl',
263+
script_url: '/project/node_modules/tinymce/tinymce.js',
264+
inline: true
265+
}))[0]);
203266
Assertions.assertStructure('Expected root to initially contain everything',
204267
ApproxStructure.fromHtml('<section class="container">' +
205268
'<div id="editor1"><p>Content</p></div>' +

src/test/ts/browser/JqTextTest.ts

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ describe('Check jQuery\'s `.text()` function', () => {
3030
it('gets the text of TinyMCE and two divs', async () => {
3131
await createHTML(`<section><div><p>Before</p></div><div id="editor"><p>Middle</p></div><div><p>After</p></div></section>`, async (root) => {
3232
const divs = $(root).find('div');
33-
const ed = (await $('#editor').tinymce({ }))[0];
33+
const ed = (await $('#editor').tinymce({
34+
license_key: 'gpl',
35+
script_url: '/project/node_modules/tinymce/tinymce.js',
36+
}))[0];
3437
try {
3538
Assertions.assertEq('Expected matching text', 'BeforeMiddleAfter', divs.text());
3639
} finally {
@@ -54,7 +57,10 @@ describe('Check jQuery\'s `.text()` function', () => {
5457
it('sets the content of multiple things simultaneously', async () => {
5558
await createHTML(`<section><div>Before</div><div id="editor"></div></section>`, async (root) => {
5659
const divs = root.querySelectorAll('div');
57-
const ed = (await $('#editor').tinymce({ }))[0];
60+
const ed = (await $('#editor').tinymce({
61+
license_key: 'gpl',
62+
script_url: '/project/node_modules/tinymce/tinymce.js',
63+
}))[0];
5864
try {
5965
$(divs).text('Hello');
6066
Assertions.assertEq('Expected matching html', 'Hello', divs[0].innerHTML);
@@ -80,7 +86,10 @@ describe('Check jQuery\'s `.text()` function', () => {
8086
it('sets the content of multiple things simultaneously', async () => {
8187
await createHTML(`<section><div>Before</div><div id="editor"></div></section>`, async (root) => {
8288
const divs = root.querySelectorAll('div');
83-
const ed = (await $('#editor').tinymce({ }))[0];
89+
const ed = (await $('#editor').tinymce({
90+
license_key: 'gpl',
91+
script_url: '/project/node_modules/tinymce/tinymce.js',
92+
}))[0];
8493
try {
8594
$(divs).text(9007199254740991);
8695
Assertions.assertEq('Expected matching html', '9007199254740991', divs[0].innerHTML);
@@ -106,7 +115,10 @@ describe('Check jQuery\'s `.text()` function', () => {
106115
it('sets the content of multiple things simultaneously', async () => {
107116
await createHTML(`<section><div>Before</div><div id="editor"></div></section>`, async (root) => {
108117
const divs = root.querySelectorAll('div');
109-
const ed = (await $('#editor').tinymce({ }))[0];
118+
const ed = (await $('#editor').tinymce({
119+
license_key: 'gpl',
120+
script_url: '/project/node_modules/tinymce/tinymce.js'
121+
}))[0];
110122
try {
111123
$(divs).text(true);
112124
Assertions.assertEq('Expected matching html', 'true', divs[0].innerHTML);
@@ -144,7 +156,10 @@ describe('Check jQuery\'s `.text()` function', () => {
144156
it('sets the content of multiple things simultaneously', async () => {
145157
await createHTML(`<section><div>Content</div><div id="editor">Content</div></section>`, async (root) => {
146158
const divs = root.querySelectorAll('div');
147-
const ed = (await $('#editor').tinymce({ }))[0];
159+
const ed = (await $('#editor').tinymce({
160+
license_key: 'gpl',
161+
script_url: '/project/node_modules/tinymce/tinymce.js'
162+
}))[0];
148163
try {
149164
$(divs).text(function (index, prevValue) {
150165
Assertions.assertEq('Expected matching this', divs[index], this);
@@ -186,7 +201,10 @@ describe('Check jQuery\'s `.text()` function', () => {
186201
it('sets the content of multiple things simultaneously', async () => {
187202
await createHTML(`<section><div>Content</div><div id="editor">Content</div></section>`, async (root) => {
188203
const divs = root.querySelectorAll('div');
189-
const ed = (await $('#editor').tinymce({ }))[0];
204+
const ed = (await $('#editor').tinymce({
205+
license_key: 'gpl',
206+
script_url: '/project/node_modules/tinymce/tinymce.js'
207+
}))[0];
190208
try {
191209
$(divs).text(function (index, prevValue) {
192210
Assertions.assertEq('Expected matching this', divs[index], this);
@@ -229,7 +247,10 @@ describe('Check jQuery\'s `.text()` function', () => {
229247
it('sets the content of multiple things simultaneously', async () => {
230248
await createHTML(`<section><div>Content</div><div id="editor">Content</div></section>`, async (root) => {
231249
const divs = root.querySelectorAll('div');
232-
const ed = (await $('#editor').tinymce({ }))[0];
250+
const ed = (await $('#editor').tinymce({
251+
license_key: 'gpl',
252+
script_url: '/project/node_modules/tinymce/tinymce.js'
253+
}))[0];
233254
try {
234255
$(divs).text(function (index, prevValue) {
235256
Assertions.assertEq('Expected matching this', divs[index], this);

src/test/ts/browser/LoadTest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ describe('LoadTest', () => {
1717
const ce = SugarElement.fromTag('div');
1818
Class.add(ce, 'test-editor');
1919
Insert.append(SugarBody.body(), ce);
20-
2120
await new Promise<void>((resolve) => {
2221
$('div.test-editor').tinymce({
2322
license_key: 'gpl',

src/test/ts/browser/OriginalTest.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ describe('OriginalTest', () => {
9696
});
9797

9898
it('applyPatch is only called once', () => {
99-
const options = {};
99+
const options = {
100+
license_key: 'gpl',
101+
script_url: '/project/node_modules/tinymce/tinymce.js',
102+
};
100103

101104
$('#elm1').tinymce(options).catch((err) => {
102105
/* eslint-disable-next-line no-console */

0 commit comments

Comments
 (0)