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

feat(Accordion): allow empty or hidden accordion rows #1767

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

booc0mtaco
Copy link
Contributor

@booc0mtaco booc0mtaco commented Sep 26, 2023

Summary:

  • adding an isExpandable={false} to an AccordianRow will hide the feature that afford clicking
  • add tests to verify this behavior
  • add new snapshots

Test Plan:

  • Wrote automated tests
  • CI tests / new tests are not applicable
  • Manually tested my changes, but I want to keep the details secret
  • Manually tested my changes, and here are the details:
    • Create an alpha publish and try out in edu-stack or traject as a sanity check if changes affect build or deploy, or are breaking, such as token changes, widely used component updates, hooks changes, and major dependency upgrades.

@booc0mtaco
Copy link
Contributor Author

Screenshot 2023-09-26 at 17 30 16

@booc0mtaco booc0mtaco requested a review from a team September 26, 2023 22:31
@booc0mtaco booc0mtaco added the do not merge PRs that should not be merged (even if the build is green or there are approvals) label Sep 26, 2023
@github-actions
Copy link

github-actions bot commented Sep 26, 2023

size-limit report 📦

Path Size
components 95.74 KB (+0.09% 🔺)
styles 32.79 KB (+0.13% 🔺)

@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #1767 (e459f9b) into next (79f1b9f) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             next    #1767      +/-   ##
==========================================
+ Coverage   92.24%   92.27%   +0.02%     
==========================================
  Files         146      146              
  Lines        2606     2615       +9     
  Branches      681      687       +6     
==========================================
+ Hits         2404     2413       +9     
  Misses        186      186              
  Partials       16       16              
Files Coverage Δ
src/components/Accordion/Accordion.tsx 97.01% <100.00%> (+0.46%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@booc0mtaco
Copy link
Contributor Author

TBD:

  • including the content on a row (.Panel) if marked as empty?
  • form handling recommendations
  • clearer documentation
  • sync with design

@booc0mtaco booc0mtaco removed the do not merge PRs that should not be merged (even if the build is green or there are approvals) label Sep 27, 2023
);
const accordionButton = screen.getByTestId('accordion-button');

await act(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does anything bad happen if we remove the act?

user.click is supposed to have that baked into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it generates a gross warning when act() is not present:

Warning: An update to DisclosureFn inside a test was not wrapped in act(...).

    When testing, code that causes React state updates should be wrapped into act(...):

    act(() => {
      /* fire events that update state */
    });
    /* assert on the output */

- adding an 'isExpandable' set to falsewill hide the features that afford clicking
- add tests to verify this behavior
- add new snapshots
@booc0mtaco booc0mtaco merged commit e044a85 into next Sep 29, 2023
8 checks passed
@booc0mtaco booc0mtaco deleted the aholloway/EFI-1360 branch September 29, 2023 21:26
@booc0mtaco booc0mtaco mentioned this pull request Oct 3, 2023
booc0mtaco added a commit that referenced this pull request Oct 4, 2023
## [13.4.0](v13.3.0...v13.4.0) (2023-10-03)


### Features

* **Accordion:** allow empty or hidden accordion rows ([#1767](#1767)) ([e044a85](e044a85))
* **Icons:** allow component icon usages to be headless ([#1761](#1761)) ([ba454bf](ba454bf))
* **InputField:** support recommendedMaxLength prop for display-only errors ([#1771](#1771)) ([cc84a20](cc84a20))
* **Tabs:** add ability to customize tab button headers ([#1768](#1768)) ([f231ad4](f231ad4))
* **TextareaField:** support recommendedMaxLength prop for display-only errors ([#1769](#1769)) ([0852356](0852356))
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.

2 participants