-
Notifications
You must be signed in to change notification settings - Fork 89
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 measured-to-track
- Loading branch information
Showing
8 changed files
with
78 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@salt-ds/core": minor | ||
--- | ||
|
||
Added new `basis` prop to FlexItem to control flex-basis |
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
31 changes: 31 additions & 0 deletions
31
packages/core/src/__tests__/__e2e__/flex-item/FlexItem.cy.tsx
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,31 @@ | ||
import * as flexStories from "@stories/flex-item/flex-item.stories"; | ||
import { composeStories } from "@storybook/testing-react"; | ||
|
||
const composedStories = composeStories(flexStories); | ||
const { FlexItemWrapper } = composedStories; | ||
|
||
describe("GIVEN a FlexItem in FlexLayout", () => { | ||
describe("WHEN no props are provided", () => { | ||
it("THEN it should render default flex properties", () => { | ||
cy.mount(<FlexItemWrapper />); | ||
|
||
cy.get(".saltFlexLayout > .saltFlexItem") | ||
.first() | ||
.should("have.css", "flex-grow", "0") | ||
.should("have.css", "flex-shrink", "1") | ||
.should("have.css", "flex-basis", "auto"); | ||
}); | ||
}); | ||
|
||
describe("WHEN flex props are provided", () => { | ||
it("THEN it should render properties with overridden value", () => { | ||
cy.mount(<FlexItemWrapper grow={2} shrink={2} basis="100px" />); | ||
|
||
cy.get(".saltFlexLayout > .saltFlexItem") | ||
.first() | ||
.should("have.css", "flex-grow", "2") | ||
.should("have.css", "flex-shrink", "2") | ||
.should("have.css", "flex-basis", "100px"); | ||
}); | ||
}); | ||
}); |
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