forked from jsillitoe/react-currency-input
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from ericblade/dev
More work on organizing tests with new playwright
- Loading branch information
Showing
3 changed files
with
58 additions
and
33 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,24 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import * as path from 'path'; | ||
|
||
const projectDir = path.resolve(__dirname, '../'); | ||
const filePath = path.join(projectDir, 'examples/index.html'); | ||
const fileUrl = `file://${filePath}`; | ||
|
||
test.describe('base tests', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto(fileUrl); | ||
}); | ||
|
||
test('sanity startup', async ({ page }) => { | ||
const currencyInput = await page.locator('#currency-input'); | ||
await expect(currencyInput).toHaveValue('$0.00 USD'); | ||
}); | ||
|
||
test('undefined value results in correct 0 of input', async ({ page }) => { | ||
const nullInputTest = await page.locator('#null-input-test'); | ||
await expect(nullInputTest).toHaveValue('$0.00 USD'); | ||
}); | ||
}); | ||
|
||
// TODO: add tests for each of the possible parameters |
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