Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions apps/meteor/tests/e2e/engagement-dashboard.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { test, expect } from './utils/test';
import { Admin } from './page-objects';
import { IS_EE } from './config/constants';

test.skip(!IS_EE, 'Engagemente Dashboard > Enterprise Only');

test.use({ storageState: 'admin-session.json' });

test.describe('engagement-dashboard', () => {
let poAdmin: Admin;

test.describe.parallel('expect to trigger fallback error component', () => {
test.beforeEach(async ({ page }) => {
poAdmin = new Admin(page);
await page.goto('/admin');

await page.route('**/api/v1/engagement-dashboard/**', (route) => route.abort());
await poAdmin.sidenav.linkEngagementDashboard.click();
await expect(page.locator('[data-qa="EngagementDashboardPage"]')).toBeVisible();
});

test('expect to show 4 fallback errors components inside widget at Users Tab', async ({ page }) => {
await expect(
page.locator('[data-qa-id="EngagementDashboardPage-usersTab"][aria-selected="true"]', { hasText: 'Users' }),
).toBeVisible();

await page.waitForSelector('[data-qa="EngagementDashboardCardErrorBoundary"]');
await expect(page.locator('[data-qa="EngagementDashboardCardErrorBoundary"]')).toHaveCount(4);
});

test('expect to show 2 fallback errors components inside widget at Messages Tab', async ({ page }) => {
await page.locator('[data-qa-id="EngagementDashboardPage-messagesTab"]').click();
await expect(
page.locator('[data-qa-id="EngagementDashboardPage-messagesTab"][aria-selected="true"]', { hasText: 'Messages' }),
).toBeVisible();

await page.waitForSelector('[data-qa="EngagementDashboardCardErrorBoundary"]');
await expect(page.locator('[data-qa="EngagementDashboardCardErrorBoundary"]')).toHaveCount(2);
});

test('expect to show a fallback error component inside widget at Channels Tab', async ({ page }) => {
await page.locator('[data-qa-id="EngagementDashboardPage-channelsTab"]').click();
await expect(
page.locator('[data-qa-id="EngagementDashboardPage-channelsTab"][aria-selected="true"]', { hasText: 'Channels' }),
).toBeVisible();

await page.waitForSelector('[data-qa="EngagementDashboardCardErrorBoundary"]');
await expect(page.locator('[data-qa="EngagementDashboardCardErrorBoundary"]')).toBeVisible();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ export class AdminSidenav {
get linkSettings(): Locator {
return this.page.locator('.flex-nav [href="/admin/settings"]');
}

get linkEngagementDashboard(): Locator {
return this.page.locator('.flex-nav [href="/admin/engagement-dashboard"]');
}
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20359,7 +20359,7 @@ __metadata:
optional: true
bin:
lessc: ./bin/lessc
checksum: 61568b56b5289fdcfe3d51baf3c13e7db7140022c0a37ef0ae343169f0de927a4b4f4272bc10c20101796e8ee79e934e024051321bba93b3ae071f734309bd98
checksum: c9b8c0e865427112c48a9cac36f14964e130577743c29d56a6d93b5812b70846b04ccaa364acf1e8d75cee3855215ec0a2d8d9de569c80e774f10b6245f39b7d
languageName: node
linkType: hard

Expand Down