Skip to content

Commit

Permalink
Test fixes (#4532)
Browse files Browse the repository at this point in the history
fixes #4531 
<!-- Link to relevant issue (for ex: "fixes #1234") which will
automatically close the issue once the PR is merged -->

## PR Type
<!-- Please uncomment one ore more that apply to this PR -->

<!-- - Bugfix -->
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
Build or CI related changes
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## Describe the current behavior?
<!-- Please describe the current behavior that is being modified or link
to a relevant issue. -->
Tests were failing because of the issue described in the linked bug.

## Describe the new behavior?
Tests have been updated to:
- account for the `visually-hidden` text
- properly wait on the tests to pass before testing to see if the
package button is disabled or not

## PR Checklist

- [x ] Test: run `npm run test` and ensure that all tests pass
- [ xTarget main branch (or an appropriate release branch if appropriate
for a bug fix)
- [x ] Ensure that your contribution follows [standard accessibility
guidelines](https://docs.microsoft.com/en-us/microsoft-edge/accessibility/design).
Use tools like https://webhint.io/ to validate your changes.


## Additional Information

Co-authored-by: Justin Willis (HE / HIM) <[email protected]>
Co-authored-by: Beth Pan <[email protected]>
  • Loading branch information
3 people authored Nov 15, 2023
1 parent b6abd23 commit 2f76759
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/pwabuilder/tests/report-card.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test('ensure demo app is testable', async ({ page }) => {
await expect(reportCardAppTitle).toBeVisible();

// // expect reportCardAppTitle to contain text "Webboard"
await expect(reportCardAppTitle).toHaveText('Webboard');
await expect(reportCardAppTitle).toContainText('Webboard');
});

test('ensure Package For Stores button is not disabled for demo app', async ({ page }) => {
Expand All @@ -53,6 +53,8 @@ test('ensure Package For Stores button is not disabled for demo app', async ({ p
// wait for tests to end
await page.waitForLoadState('networkidle');

await page.waitForSelector("id=swProgressRing");

// test manifest score
const packageForStoresButton = page.locator('text=Package For Stores');
await expect(await packageForStoresButton.isDisabled()).toBe(false);
Expand Down

0 comments on commit 2f76759

Please sign in to comment.