Skip to content

Commit da9137c

Browse files
add: e2e tests for features
1 parent 33d0c51 commit da9137c

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

tests/e2e/specs/classic-block.spec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,30 @@ test.describe('Feedzy Classic Block', () => {
124124
const image = page.locator('.feedzy-rss .rss_image img');
125125
await expect(image).toHaveAttribute('style', /aspect-ratio:\s*auto;/i);
126126
});
127+
128+
test('embed youtube video', async ({ editor, page, admin }) => {
129+
await admin.createNewPost();
130+
131+
await editor.insertBlock({
132+
name: 'feedzy-rss-feeds/feedzy-block',
133+
attributes: {
134+
feeds: 'https://www.youtube.com/feeds/videos.xml?channel_id=UCSHmNs-_UuU1CfPhSbilTZQ',
135+
max: 1,
136+
},
137+
});
138+
139+
const postId = await editor.publishPost();
140+
await page.goto(`/?p=${postId}`);
141+
142+
const rssContainer = page.locator('.rss_item').first();
143+
await expect(rssContainer).toBeVisible();
144+
145+
const youtubeLink = rssContainer
146+
.locator('a[href*="youtube.com/"]')
147+
.first();
148+
await expect(youtubeLink).toBeVisible();
149+
150+
const image = rssContainer.locator('img').first();
151+
await expect(image).toBeVisible();
152+
});
127153
});

tests/e2e/specs/import.spec.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,4 +304,61 @@ test.describe('Feed Import', () => {
304304
page.locator('.attachment').count()
305305
).resolves.toBeGreaterThan(0); // We should have some imported images.
306306
});
307+
308+
test('close popup when clicking outside', async ({ page }) => {
309+
await page.goto('/wp-admin/post-new.php?post_type=feedzy_imports');
310+
await tryCloseTourModal(page);
311+
312+
await page
313+
.getByRole('button', { name: 'Step 3 Map content ' })
314+
.click();
315+
316+
await expect(
317+
page.getByText('Post Title item title Item')
318+
).toBeVisible();
319+
320+
await page.getByTitle('item title').getByRole('link').click();
321+
322+
await expect(
323+
page.getByRole('heading', { name: 'Add actions to this tag' })
324+
).toBeVisible();
325+
326+
await page.locator('body').click({ position: { x: 0, y: 0 } });
327+
328+
await expect(
329+
page.getByRole('heading', { name: 'Add actions to this tag' })
330+
).not.toBeVisible();
331+
});
332+
333+
test('taxonomy settings for free', async ({ page }) => {
334+
await page.goto('/wp-admin/post-new.php?post_type=feedzy_imports');
335+
await tryCloseTourModal(page);
336+
337+
await page
338+
.getByRole('button', { name: 'Step 3 Map content ' })
339+
.click();
340+
341+
await page
342+
.locator('#feedzy_post_terms_chosen')
343+
.getByRole('list')
344+
.first()
345+
.click();
346+
347+
await expect(
348+
page.getByText(
349+
'CategoryUncategorizedProseparatorItem CategoriesPROAuto Categories by keywordPRO'
350+
)
351+
).toBeVisible();
352+
});
353+
354+
test('check if user can add pro features in free', async ({ page }) => {
355+
await page.goto('/wp-admin/post-new.php?post_type=feedzy_imports');
356+
await tryCloseTourModal(page);
357+
358+
await page.getByRole('button', { name: 'Step 2 Filters ' }).click();
359+
360+
await page.waitForTimeout(1000);
361+
362+
await expect(page.getByLabel('Include If')).toBeDisabled();
363+
});
307364
});

0 commit comments

Comments
 (0)