-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show "Start Anytime" based on resource "availability" property (#1336)
* fix storybook embedly, add card root classes * add anytime to LR cards * add docstrings to formatDate * add anytime to LR expanded display * add two card tests * capitalize semester * fix info height
- Loading branch information
1 parent
f7c8e69
commit f71c91a
Showing
18 changed files
with
464 additions
and
190 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 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 |
---|---|---|
|
@@ -3,8 +3,3 @@ | |
WARNING: This is linked to [email protected]'s Adobe account. | ||
--> | ||
<link rel="stylesheet" href="https://use.typekit.net/lbk1xay.css" /> | ||
<script> | ||
window.APP_SETTINGS = { | ||
embedlyKey: null, | ||
} | ||
</script> |
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,32 @@ | ||
import { render } from "@testing-library/react" | ||
import { Card } from "./Card" | ||
import React from "react" | ||
|
||
describe("Card", () => { | ||
test("has class MitCard-root on root element", () => { | ||
const { container } = render( | ||
<Card className="Foo"> | ||
<Card.Title>Title</Card.Title> | ||
<Card.Image src="https://via.placeholder.com/150" alt="placeholder" /> | ||
<Card.Info>Info</Card.Info> | ||
<Card.Footer>Footer</Card.Footer> | ||
<Card.Actions>Actions</Card.Actions> | ||
</Card>, | ||
) | ||
const card = container.firstChild as HTMLElement | ||
const title = card.querySelector(".MitCard-title") | ||
const image = card.querySelector(".MitCard-image") | ||
const info = card.querySelector(".MitCard-info") | ||
const footer = card.querySelector(".MitCard-footer") | ||
const actions = card.querySelector(".MitCard-actions") | ||
|
||
expect(card).toHaveClass("MitCard-root") | ||
expect(card).toHaveClass("Foo") | ||
expect(title).toHaveTextContent("Title") | ||
expect(image).toHaveAttribute("src", "https://via.placeholder.com/150") | ||
expect(image).toHaveAttribute("alt", "placeholder") | ||
expect(info).toHaveTextContent("Info") | ||
expect(footer).toHaveTextContent("Footer") | ||
expect(actions).toHaveTextContent("Actions") | ||
}) | ||
}) |
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
17 changes: 17 additions & 0 deletions
17
frontends/ol-components/src/components/Card/ListCard.test.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,17 @@ | ||
import { render } from "@testing-library/react" | ||
import { ListCard } from "./ListCard" | ||
import React from "react" | ||
|
||
describe("ListCard", () => { | ||
test("has class MitCard-root on root element", () => { | ||
const { container } = render( | ||
<ListCard className="Foo"> | ||
<ListCard.Content>Hello world</ListCard.Content> | ||
</ListCard>, | ||
) | ||
const card = container.firstChild | ||
|
||
expect(card).toHaveClass("MitListCard-root") | ||
expect(card).toHaveClass("Foo") | ||
}) | ||
}) |
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.