-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 709-update-contributionmd
- Loading branch information
Showing
42 changed files
with
273 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Security Issues | ||
url: mailto:[email protected] | ||
about: Please responsibly disclose security issues by emailing us at [email protected]. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Request new SDS component | ||
description: Request a component be added to SDS | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for requesting a new component in the SDS! Please fill out the following information about the requested component. | ||
- type: input | ||
id: component-name | ||
attributes: | ||
label: Component Name | ||
description: A name for the desired component. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: component-requirements | ||
attributes: | ||
label: Component Requirements | ||
description: A list of requirements for the component. | ||
validations: | ||
required: true | ||
- type: input | ||
id: mui-base-component | ||
attributes: | ||
label: MUI Base Component (if applicable) | ||
description: If the component is based on a Material-UI component, please specify. | ||
placeholder: e.g., MUI Button | ||
validations: | ||
required: false | ||
- type: input | ||
id: teams-requesting | ||
attributes: | ||
label: Team(s) Requesting | ||
description: The team(s) that need this component. | ||
validations: | ||
required: true | ||
- type: input | ||
id: component-needed-by | ||
attributes: | ||
label: Component Needed By | ||
description: The date by which the component is needed. | ||
validations: | ||
required: true | ||
- type: input | ||
id: component-screenshot | ||
attributes: | ||
label: Component Screenshot / Prototype | ||
description: A link to a screenshot or prototype of the component. | ||
validations: | ||
required: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Request support | ||
description: Request support for a SDS component | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Please fill out the form below to request help with a SDS component. | ||
- type: input | ||
id: component-name | ||
attributes: | ||
label: Component Name | ||
description: Component that help request is for. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: issue-description | ||
attributes: | ||
label: Issue description | ||
description: Details about the issue with the component. | ||
validations: | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import "@testing-library/jest-dom"; | ||
import "../../intersectionObserverMock"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,41 @@ | ||
import { generateSnapshots } from "@chanzuckerberg/story-utils"; | ||
import { composeStory } from "@storybook/react"; | ||
import { fireEvent, render, screen } from "@testing-library/react"; | ||
import * as snapshotTestStoryFile from "./index.stories"; | ||
import Meta, { Test as TestStory } from "./index.stories"; | ||
import { composeStories } from "@storybook/react"; | ||
import { fireEvent, render, screen, waitFor } from "@testing-library/react"; | ||
import * as stories from "./index.stories"; | ||
|
||
// Returns a component that already contain all decorators from story level, meta level and global level. | ||
const Test = composeStory(TestStory, Meta); | ||
const { Test } = composeStories(stories); | ||
|
||
describe("<Accordion />", () => { | ||
generateSnapshots(snapshotTestStoryFile); | ||
generateSnapshots(stories); | ||
|
||
it("renders accordion component", () => { | ||
render(<Test {...Test.args} />); | ||
render(<Test />); | ||
const accordionElement = screen.getByTestId("accordion"); | ||
expect(accordionElement).not.toBeNull(); | ||
}); | ||
|
||
it("opens accordion when clicked", () => { | ||
it("opens and closes the accordion when clicked", async () => { | ||
const ariaExpanded = "aria-expanded"; | ||
|
||
render(<Test />); | ||
const accordionElement = screen.getByTestId("accordion"); | ||
fireEvent.click(accordionElement); | ||
expect( | ||
screen.getAllByText( | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget." | ||
) | ||
).not.toBeNull(); | ||
|
||
// Starts closed | ||
const accordionHeader = screen.getByRole("button"); | ||
expect(accordionHeader).toHaveAttribute(ariaExpanded, "false"); | ||
expect(screen.getByText(/Lorem ipsum/)).not.toBeVisible(); | ||
|
||
// It opens when clicked. | ||
fireEvent.click(accordionHeader); | ||
expect(accordionHeader).toHaveAttribute(ariaExpanded, "true"); | ||
expect(screen.getByText(/Lorem ipsum/)).toBeVisible(); | ||
|
||
// And closes when clicked again. | ||
fireEvent.click(accordionHeader); | ||
expect(accordionHeader).toHaveAttribute(ariaExpanded, "false"); | ||
|
||
await waitFor(() => { | ||
expect(screen.getByText(/Lorem ipsum/)).not.toBeVisible(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.