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

DSD-1746: FeedbackBox interaction tests #1628

Merged
merged 4 commits into from
Jun 28, 2024

Conversation

7emansell
Copy link
Collaborator

@7emansell 7emansell commented Jun 24, 2024

Fixes JIRA ticket DSD-1746

This PR does the following:

  • Adds interaction tests in Storybook for the FeedbackBox component

How has this been tested?

Accessibility concerns or updates

Checklist:

  • I have updated the Storybook documentation accordingly.
  • I have added relevant accessibility documentation for this pull request.
  • All new and existing tests passed.

Front End Review:

  • Review the Vercel preview deployment once it is ready.

Copy link

vercel bot commented Jun 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nypl-design-system ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2024 1:50pm

Copy link
Member

@EdwinGuzman EdwinGuzman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to get tests for the other fields but I'm not sure if you can rerender the component and set showCategoryField and showEmailField to true. Maybe those should be set to true for storybook, but that can be separate and a later step.

@@ -1,6 +1,7 @@
import { Box } from "@chakra-ui/react";
import type { Meta, StoryObj } from "@storybook/react";
import { useState } from "react";
import { userEvent, expect, screen } from "@storybook/test";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not know you can get the mounted DOM directly from the package. I've been doing const screen = within(canvasElement);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, something to remember for Modal for sure bc screen here is not the same as within(canvasElement)

@7emansell
Copy link
Collaborator Author

It'd be nice to get tests for the other fields but I'm not sure if you can rerender the component and set showCategoryField and showEmailField to true. Maybe those should be set to true for storybook, but that can be separate and a later step.

@bigfishdesign13 I think we've done this before with the Searchbar interaction tests (added props to the default component just so they can be tested) so I think it would make sense to do here as well, but lmk

@bigfishdesign13
Copy link
Collaborator

It'd be nice to get tests for the other fields but I'm not sure if you can rerender the component and set showCategoryField and showEmailField to true. Maybe those should be set to true for storybook, but that can be separate and a later step.

@bigfishdesign13 I think we've done this before with the Searchbar interaction tests (added props to the default component just so they can be tested) so I think it would make sense to do here as well, but lmk

@7emansell Yes, I think that would be fine to set showCategoryField and showEmailField to true for the With Controls story.

@EdwinGuzman The next release is next Thursday, so there would be time to tackle this change as part of this ticket.

@EdwinGuzman EdwinGuzman added the Ship It Pull requests that have been reviewed and approved. label Jun 26, 2024
@7emansell 7emansell merged commit 40e9625 into development Jun 28, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ship It Pull requests that have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants