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(grid): add align start and align end prop #17740

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

alisonjoseph
Copy link
Member

Closes #17245

Add new align prop to Grid, update tests for Grid and FlexGrid

Changelog

New

  • align prop
  • Add tests for Grid component

Testing / Reviewing

View default Grid story on wide monitor to see align start and align end examples. (revert story demo before merge)

Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 411c03b
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/67190bde44a84b00098d6697
😎 Deploy Preview https://deploy-preview-17740--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 411c03b
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67190bde08031c00081aad24
😎 Deploy Preview https://deploy-preview-17740--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.15%. Comparing base (8a75cb5) to head (411c03b).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17740   +/-   ##
=======================================
  Coverage   80.14%   80.15%           
=======================================
  Files         406      406           
  Lines       14030    14030           
  Branches     4391     4343   -48     
=======================================
+ Hits        11245    11246    +1     
+ Misses       2619     2618    -1     
  Partials      166      166           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

looks good to me!

beforeEach(() => {
jest.resetModules();
const FeatureFlags = require('@carbon/feature-flags');
FeatureFlags.enable('enable-css-grid');
Copy link
Member

Choose a reason for hiding this comment

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

IIRC This is true by default

Copy link
Member Author

Choose a reason for hiding this comment

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

It should be, without adding this however it was testing the flex grid version of the component. I realized after seeing the tests for the new prop fail and console.logging the output. I wonder if it could be avoided here if I import and test CSSGrid instead?

https://github.com/carbon-design-system/carbon/blob/main/packages/react/src/components/Grid/Grid.tsx#L16-L20

Comment on lines +65 to +68
cleanup = require('@testing-library/react/pure').cleanup;
render = require('@testing-library/react/pure').render;
screen = require('@testing-library/react/pure').screen;
Grid = require('../Grid').Grid;
Copy link
Member

Choose a reason for hiding this comment

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

Hey I'm curious, is this a new pattern we need to follow in certain situations? I know there's been some changes like this in best practices for @testing-library but haven't seen this before.

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually pulled this code from the Column-test file when looking for an example of how we were enabling the feature flag within tests.

Copy link

netlify bot commented Oct 23, 2024

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 411c03b
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/67190bdee898680008e8f9de
😎 Deploy Preview https://deploy-preview-17740--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@alisonjoseph alisonjoseph added this pull request to the merge queue Oct 23, 2024
Merged via the queue into carbon-design-system:main with commit fa832a8 Oct 23, 2024
39 of 40 checks passed
@alisonjoseph alisonjoseph deleted the grid-align branch October 23, 2024 18:12
@carbon-automation
Copy link
Contributor

Hey there! v11.69.0 was just released that references this issue/PR.

irfadkp pushed a commit to irfadkp/carbon that referenced this pull request Oct 24, 2024
…17740)

* feat(grid): add align start and align end prop

* chore: revert changes

---------

Co-authored-by: Gururaj J <89023023+Gururajj77@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Property for Grid to change the alignment
4 participants