-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James Friedman
committed
Jan 10, 2018
1 parent
c0c6180
commit 8d7a902
Showing
2 changed files
with
51 additions
and
49 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 |
---|---|---|
@@ -1,56 +1,56 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { | ||
Card, | ||
CardMedia, | ||
CardPrimary, | ||
CardTitle, | ||
CardSubtitle, | ||
CardSupportingText, | ||
CardActions, | ||
CardAction | ||
Card, | ||
CardMedia, | ||
CardPrimary, | ||
CardTitle, | ||
CardSubtitle, | ||
CardSupportingText, | ||
CardActions, | ||
CardAction | ||
} from './'; | ||
|
||
describe('Card', () => { | ||
it('renders', () => { | ||
mount( | ||
<Card style={{ width: '320px' }}> | ||
<CardMedia | ||
style={{ | ||
height: '12.313rem' | ||
}} | ||
/> | ||
<CardPrimary> | ||
<CardTitle large>Card Title</CardTitle> | ||
<CardSubtitle>Subtitle here</CardSubtitle> | ||
</CardPrimary> | ||
<CardSupportingText /> | ||
<CardActions> | ||
<CardAction>Action 1</CardAction> | ||
<CardAction>Action 2</CardAction> | ||
</CardActions> | ||
</Card> | ||
); | ||
}); | ||
it('renders', () => { | ||
mount( | ||
<Card style={{ width: '320px' }}> | ||
<CardMedia | ||
style={{ | ||
height: '12.313rem' | ||
}} | ||
/> | ||
<CardPrimary> | ||
<CardTitle large>Card Title</CardTitle> | ||
<CardSubtitle>Subtitle here</CardSubtitle> | ||
</CardPrimary> | ||
<CardSupportingText /> | ||
<CardActions> | ||
<CardAction>Action 1</CardAction> | ||
<CardAction>Action 2</CardAction> | ||
</CardActions> | ||
</Card> | ||
); | ||
}); | ||
|
||
it('can be dark', () => { | ||
const card = mount(<Card themeDark />); | ||
expect(!!~card.html().search('mdc-card--theme-dark')).toEqual(true); | ||
}); | ||
it('can be dark', () => { | ||
const card = mount(<Card themeDark />); | ||
expect(!!~card.html().search('mdc-card--theme-dark')).toEqual(true); | ||
}); | ||
|
||
it('can have custom classes', () => { | ||
[ | ||
Card, | ||
CardMedia, | ||
CardPrimary, | ||
CardTitle, | ||
CardSubtitle, | ||
CardSupportingText, | ||
CardActions, | ||
CardAction | ||
].forEach(Component => { | ||
const el = mount(<Component className={'my-custom-classname'} />); | ||
expect(!!~el.html().search('my-custom-classname')).toEqual(true); | ||
}); | ||
}); | ||
it('can have custom classes', () => { | ||
[ | ||
Card, | ||
CardMedia, | ||
CardPrimary, | ||
CardTitle, | ||
CardSubtitle, | ||
CardSupportingText, | ||
CardActions, | ||
CardAction | ||
].forEach(Component => { | ||
const el = mount(<Component className={'my-custom-classname'} />); | ||
expect(!!~el.html().search('my-custom-classname')).toEqual(true); | ||
}); | ||
}); | ||
}); |
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