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

[NO-JIRA] Migrate Floating Notification component to TS #3221

Merged
merged 8 commits into from
Feb 8, 2024

Conversation

danielmartinezskyscanner
Copy link
Contributor

Description

Isotopes squad started to use the Floating Notification component for SAM and decided to contribute migrating this component to TS.

Remember to include the following changes:

  • Ensure the PR title includes the name of the component you are changing so it's clear in the release notes for consumers of the changes in the version e.g [KOA-123][BpkButton] Updating the colour
  • README.md (If you have created a new component)
  • Component README.md
  • Tests
  • Storybook examples created/updated
  • For breaking changes or deprecating components/properties, migration guides added to the description of the PR. If the guide has large changes, consider creating a new Markdown page inside the component's docs folder and link it here

@danielmartinezskyscanner danielmartinezskyscanner added the minor Non breaking change label Feb 6, 2024
Copy link

github-actions bot commented Feb 6, 2024

Browser support

If this is a visual change, make sure you've tested it in multiple browsers.

Generated by 🚫 dangerJS against d5e973f

Copy link

github-actions bot commented Feb 6, 2024

Visit https://backpack.github.io/storybook-prs/3221 to see this build running in a browser.

Copy link

github-actions bot commented Feb 7, 2024

Visit https://backpack.github.io/storybook-prs/3221 to see this build running in a browser.

Copy link

github-actions bot commented Feb 7, 2024

Visit https://backpack.github.io/storybook-prs/3221 to see this build running in a browser.

Copy link

github-actions bot commented Feb 7, 2024

Visit https://backpack.github.io/storybook-prs/3221 to see this build running in a browser.

Copy link

github-actions bot commented Feb 7, 2024

Visit https://backpack.github.io/storybook-prs/3221 to see this build running in a browser.

Copy link
Contributor

@akinniyi-akinpelu akinniyi-akinpelu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

github-actions bot commented Feb 7, 2024

Visit https://backpack.github.io/storybook-prs/3221 to see this build running in a browser.

@@ -3,7 +3,7 @@
exports[`BpkFloatingNotification should render correctly 1`] = `
<DocumentFragment>
<div
class="bpk-floating-notification bpk-floating-notification--appear bpk-floating-notification--appear-active"
class="bpk-floating-notification"
Copy link
Member

Choose a reason for hiding this comment

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

Do you know why the classnames have changed here? Looks like it might not be appearing anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting 👀 The UI behaviour was as expected but, for some reason, the tests were rendering the component without those classes. After some debugging, I found out that it was because of this change:

import { CSSTransition } from 'react-transition-group';
___________________________________________________________________

import CSSTransition from 'react-transition-group/CSSTransition';

It might be something related to babel and jest... Anyway, I already fixed it and rollbacked the snapshot changes 🙂

@@ -30,7 +31,7 @@ const props = {

describe('BpkFloatingNotification accessibility tests', () => {
it('should not have programmatically-detectable accessibility issues', async () => {
const { container } = render(<BpkFloatingNotification />);
const { container } = render(<BpkFloatingNotification {...props} />);
Copy link
Member

Choose a reason for hiding this comment

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

Just want to clarify the addition of the ...props here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The text prop is required in the component, calling it without it would fail.
I added the whole props object since it only has the text property.

Copy link

github-actions bot commented Feb 8, 2024

Visit https://backpack.github.io/storybook-prs/3221 to see this build running in a browser.

Copy link

github-actions bot commented Feb 8, 2024

Visit https://backpack.github.io/storybook-prs/3221 to see this build running in a browser.

@olliecurtis olliecurtis merged commit cfa3eaa into main Feb 8, 2024
9 checks passed
@olliecurtis olliecurtis deleted the NO-JIRA_Migrating_floating_notification_to_TS branch February 8, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Non breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants