Skip to content

Commit

Permalink
fix: use semantic card border color for cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Howard committed Sep 25, 2023
1 parent 26b601d commit 91caa57
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/Card/Card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const baseCardArgs: Object = {
size: CardSize.Medium,
style: {},
classNames: 'my-card-class',
bordered: true,
};

CustomCard.args = {
Expand Down
8 changes: 8 additions & 0 deletions src/components/Card/Card.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,12 @@ describe('Card', () => {
expect(container.getElementsByClassName('card-small')).toHaveLength(1);
expect(container).toMatchSnapshot();
});

test('Card is bordered', () => {
const { container } = render(
<Card body={body} footer={footer} header={header} bordered />
);
expect(container.getElementsByClassName('card-bordered')).toHaveLength(1);
expect(container).toMatchSnapshot();
});
});
24 changes: 24 additions & 0 deletions src/components/Card/__snapshots__/Card.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Card Card is bordered 1`] = `
<div>
<div
class="card card-bordered list card-medium"
>
<div
class="header"
>
This is the card header
</div>
<div
class="body"
>
This is the card body
</div>
<div
class="footer"
>
This is the card footer
</div>
</div>
</div>
`;

exports[`Card Card is large 1`] = `
<div>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/Card/card.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
position: relative;

&-bordered {
border: 1px solid var(--border-color);
border: 1px solid var(--card-border-color);
}

.icon {
Expand Down

0 comments on commit 91caa57

Please sign in to comment.