Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Next Version #404

Merged
merged 1 commit into from
Feb 18, 2022
Merged

Publish Next Version #404

merged 1 commit into from
Feb 18, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 9, 2022

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

pleasantest@1.7.0

Minor Changes

  • #403 6ceb029 Thanks @calebeby! - Expose accessibilityTreeSnapshotSerializer. This is the snapshot serializer that Pleasantest configures Jest to use to format accessibility tree snapshots. It was enabled by default in previous versions, and it still is, just now it is also exposed as an export so you can pass the snapshot serializer to other tools, like snapshot-diff.

    Here's an example of using this:

    This part you'd put in your test setup file (configured in Jest's setupFilesAfterEnv):

    import snapshotDiff from 'snapshot-diff';
    
    expect.addSnapshotSerializer(snapshotDiff.getSnapshotDiffSerializer());
    snapshotDiff.setSerializers([
      {
        test: accessibilityTreeSnapshotSerializer.test,
        // @ts-ignore
        print: (value) => accessibilityTreeSnapshotSerializer.serialize(value),
        diffOptions: () => ({ expand: true }),
      },
    ]);

    Then in your tests:

    const beforeSnap = await getAccessibilityTree(element);
    
    // ... interact with the DOM
    
    const afterSnap = await getAccessibilityTree(element);
    
    expect(snapshotDiff(beforeSnap, afterSnap)).toMatchInlineSnapshot(`
      Snapshot Diff:
      - First value
      + Second value
    
        region "Summary"
          heading "Summary"
            text "Summary"
          list
            listitem
              text "Items:"
      -       text "2"
      +       text "5"
          link "Checkout"
            text "Checkout"
    `);

    The diff provided by snapshotDiff automatically highlights the differences between the snapshots, to make it clear to the test reader what changed in the page accessibility structure as the interactions happened.

Patch Changes

  • #412 33ddf04 Thanks @calebeby! - Ignore HTML comments in getAccessibilityTree output (potentially breaking bugfix)

@github-actions github-actions bot force-pushed the changeset-release/main branch 4 times, most recently from 49b57a9 to ebda1cd Compare February 15, 2022 16:25
@github-actions github-actions bot force-pushed the changeset-release/main branch from ebda1cd to 6e7690d Compare February 17, 2022 21:49
@github-actions github-actions bot force-pushed the changeset-release/main branch from 6e7690d to 0ae0a4c Compare February 18, 2022 01:21
@calebeby calebeby merged commit 03aee61 into main Feb 18, 2022
@calebeby calebeby deleted the changeset-release/main branch February 18, 2022 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant