-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(proposals): test list load (#39)
- Loading branch information
Showing
4 changed files
with
42 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { type Page } from '@playwright/test'; | ||
|
||
export class ProposalsPage { | ||
readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
} | ||
|
||
async goto() { | ||
await this.page.goto('/0.wilder.beasts/daos/proposals'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { test, expect } from '../../../fixtures'; | ||
import { ProposalsPage } from '../pages/proposals'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
const proposals = new ProposalsPage(page); | ||
await proposals.goto(); | ||
}); | ||
|
||
// @note: this is a fragile test, but it will do for now | ||
test('can view a list of all proposals in a DAO', async ({ page }) => { | ||
await expect(page.getByText('Loading Proposals')).toBeVisible(); | ||
await page.waitForSelector('[data-testid="zapp-daos-view-toggle"]'); | ||
const viewToggle = page.getByTestId('zapp-daos-view-toggle'); | ||
|
||
// list view | ||
await viewToggle.getByRole('radio').first().click(); | ||
await expect(page.getByText("Let's Buy a GEN!")).toBeVisible(); | ||
|
||
// grid view | ||
await viewToggle.getByRole('radio').last().click(); | ||
await expect( | ||
page.getByText('This proposal is to gain funding for purchasing a Moto'), | ||
).toBeVisible(); | ||
}); |