From 307631c6dc77b3dcd7fdbe24e0368176b4f22dc3 Mon Sep 17 00:00:00 2001 From: TheSisb Date: Mon, 18 Mar 2024 16:23:53 -0500 Subject: [PATCH] test(icons): fix snapshot test (#3824) * test(icons): fix snapshot test * docs(icons): update self service instructions * chore(icons): fix biome formatting issues --- .../__test__/__snapshots__/icons.spec.tsx.snap | 1 + .../src/ProductAIAssistantsIcon.tsx | 18 +++++++++--------- .../introduction/contributing/icons/index.mdx | 5 +++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/paste-icons/__test__/__snapshots__/icons.spec.tsx.snap b/packages/paste-icons/__test__/__snapshots__/icons.spec.tsx.snap index 7dc42a53e7..5af7caecfc 100644 --- a/packages/paste-icons/__test__/__snapshots__/icons.spec.tsx.snap +++ b/packages/paste-icons/__test__/__snapshots__/icons.spec.tsx.snap @@ -143,6 +143,7 @@ Array [ "ProcessNeutralIcon", "ProcessSuccessIcon", "ProcessWarningIcon", + "ProductAIAssistantsIcon", "ProductAPIExplorerIcon", "ProductAddOnsIcon", "ProductAdminAccessControlIcon", diff --git a/packages/paste-icons/src/ProductAIAssistantsIcon.tsx b/packages/paste-icons/src/ProductAIAssistantsIcon.tsx index 4ca4fbe57c..0f5044be92 100644 --- a/packages/paste-icons/src/ProductAIAssistantsIcon.tsx +++ b/packages/paste-icons/src/ProductAIAssistantsIcon.tsx @@ -1,11 +1,11 @@ +import { useUID } from "@twilio-paste/uid-library"; /** * This file was automatically generated with @twilio-labs/svg-to-react */ -import * as React from 'react'; -import {useUID} from '@twilio-paste/uid-library'; +import * as React from "react"; -import {IconWrapper} from './helpers/IconWrapper'; -import type {IconWrapperProps} from './helpers/IconWrapper'; +import { IconWrapper } from "./helpers/IconWrapper"; +import type { IconWrapperProps } from "./helpers/IconWrapper"; export interface ProductAIAssistantsIconProps extends IconWrapperProps { title?: string; @@ -13,11 +13,11 @@ export interface ProductAIAssistantsIconProps extends IconWrapperProps { } const ProductAIAssistantsIcon = React.forwardRef( - ({as, display, element = 'ICON', size, color, title, decorative}, ref) => { + ({ as, display, element = "ICON", size, color, title, decorative }, ref) => { const titleId = `ProductAIAssistantsIcon-${useUID()}`; if (!decorative && title == null) { - throw new Error('[ProductAIAssistantsIcon]: Missing a title for non-decorative icon.'); + throw new Error("[ProductAIAssistantsIcon]: Missing a title for non-decorative icon."); } return ( @@ -44,8 +44,8 @@ const ProductAIAssistantsIcon = React.forwardRef ); - } + }, ); -ProductAIAssistantsIcon.displayName = 'ProductAIAssistantsIcon'; -export {ProductAIAssistantsIcon}; +ProductAIAssistantsIcon.displayName = "ProductAIAssistantsIcon"; +export { ProductAIAssistantsIcon }; diff --git a/packages/paste-website/src/pages/introduction/contributing/icons/index.mdx b/packages/paste-website/src/pages/introduction/contributing/icons/index.mdx index c781b36dc2..dbc7731d3b 100644 --- a/packages/paste-website/src/pages/introduction/contributing/icons/index.mdx +++ b/packages/paste-website/src/pages/introduction/contributing/icons/index.mdx @@ -119,10 +119,11 @@ Once the icon is designed and exported, we need to get it in the hands of our de 3. Navigate inside the newly cloned repository with cd paste 4. Install the dependencies with yarn install 5. Add all the new svg icon files into the packages/paste-icons/svg/ folder. -6. From the root Paste folder, run the following command in your terminal: `yarn workspace @twilio-paste/icons convert` +6. From the root Paste folder, run the following commands in your terminal: `yarn workspace @twilio-paste/icons convert-new` and `yarn workspace @twilio-paste/icons list-icons` 7. Verify your new icons were added correctly by checking the packages/paste-icons/src folder to see the newly created source files. 8. Create a changeset to document your updates by running `yarn changeset`. -9. Commit your changes and submit a new PR on Github! +9. Update the snapshot tests with `yarn jest --u`. +10. Commit your changes and submit a new PR on Github! ## Troubleshooting