Skip to content

Commit

Permalink
Implement playwright acceptance tests for vertical full page map
Browse files Browse the repository at this point in the history
  • Loading branch information
likimmy committed Nov 29, 2023
1 parent f5e4d76 commit 6c58224
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions e2e/vertical-full-page-map.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ test.describe('full page map with filters test suite', () => {
await page.goto('http://localhost:5042/locations_full_page_map_with_filters');
await page.getByPlaceholder('Search for locations').fill('virginia');
await page.getByPlaceholder('Search for locations').press('Enter');
await page.waitForTimeout(2000);
const response = await page.waitForResponse(resp => resp.url().includes('https://prod-cdn.us.yextapis.com/v2/accounts/me/search/vertical/query')
&& resp.url().includes('input=virginia')
&& !resp.url().includes('filters'));
await expect(response.status()).toBe(200);
});

test('clicking on a pin closes the filter view', async ({ page }) => {
Expand All @@ -98,7 +101,10 @@ test.describe('full page map with filters test suite', () => {
test('clicking on a cluster causes the map to zoom in', async ({ page }) => {
const originalCount = await page.locator('.yxt-Card').count();
await page.getByRole('button', { name: 'Cluster of 2 results' }).click();
await page.waitForTimeout(2000);
const response = await page.waitForResponse(resp => resp.url().includes('https://prod-cdn.us.yextapis.com/v2/accounts/me/search/vertical/query')
&& resp.url().includes('input=virginia')
&& resp.url().includes('filters'));
await expect(response.status()).toBe(200);
const countAfterSelectingCluster = await page.locator('.yxt-Card').count();
expect(originalCount).toBeGreaterThan(countAfterSelectingCluster);
});
Expand Down

0 comments on commit 6c58224

Please sign in to comment.