Skip to content

Commit a984290

Browse files
author
Etienne Laurent
committed
code stye
1 parent f0a721e commit a984290

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

test/rich-text-widget.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ describe('Rich Text Widget', function () {
202202
const req = apos.task.getReq();
203203
const base = apos.http.getBase();
204204

205-
// add image with alt attribute:
205+
// add images with and without alt attributes:
206206
const image1 = await apos.image.insert(req, {
207207
_id: 'image-1:en:published',
208208
type: '@apostrophecms/image',
@@ -228,8 +228,6 @@ describe('Rich Text Widget', function () {
228228
},
229229
alt: 'Test Image 1'
230230
});
231-
232-
// add image without alt attribute:
233231
const image2 = await apos.image.insert(req, {
234232
_id: 'image-2:en:published',
235233
type: '@apostrophecms/image',
@@ -256,9 +254,7 @@ describe('Rich Text Widget', function () {
256254
});
257255

258256
// update page with rich text widget containing images:
259-
260257
const page = await apos.page.find(req, { slug: '/rich-text-image-page' }).toObject();
261-
262258
page.main = {
263259
_id: 'area',
264260
metaType: 'area',
@@ -272,34 +268,27 @@ describe('Rich Text Widget', function () {
272268
}
273269
]
274270
};
275-
276271
await apos.page.update(req, page);
277272

278273
// assert that alt attributes are present in the rendered HTML:
279-
280274
const response1 = await fetch(`${base}/rich-text-image-page`, {
281275
method: 'GET'
282276
});
283277
const text1 = await response1.text();
284-
285278
assert(text1.includes('alt="Test Image 1"'));
286279
assert(text1.includes('alt=""'));
287280

288281
// update alt attributes:
289-
290282
image1.alt = 'Updated Test Image 1';
291283
image2.alt = 'Updated Test Image 2';
292-
293284
await apos.image.update(req, image1);
294285
await apos.image.update(req, image2);
295286

296287
// re-fetch the page to check if the updated alt attributes are present:
297-
298288
const response2 = await fetch(`${base}/rich-text-image-page`, {
299289
method: 'GET'
300290
});
301291
const text2 = await response2.text();
302-
303292
assert(text2.includes('alt="Updated Test Image 1"'));
304293
assert(text2.includes('alt="Updated Test Image 2"'));
305294
});

0 commit comments

Comments
 (0)