-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2805 from salesforce-ux/winter-to-spring-merge
Winter to spring merge
- Loading branch information
Showing
22 changed files
with
355 additions
and
76 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2015-present, salesforce.com, inc. All rights reserved | ||
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license | ||
|
||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
class Blockquote extends React.Component { | ||
render() { | ||
const { type = 'note' } = this.props; | ||
return ( | ||
// types include: note (default), ally, warning | ||
<blockquote className={`doc site-blockquote_${type}`}> | ||
{this.props.header ? ( | ||
<p className="doc lead">{this.props.header}</p> | ||
) : null} | ||
<p className="doc">{this.props.children}</p> | ||
</blockquote> | ||
); | ||
} | ||
} | ||
|
||
export default Blockquote; |
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,25 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import Blockquote from '../Blockquote'; | ||
|
||
describe('Blockquote', () => { | ||
it('Renders the note blockquote', () => { | ||
const wrapper = shallow(<Blockquote />); | ||
expect(wrapper.find('.site-blockquote_note').length).toEqual(1); | ||
}); | ||
|
||
it('Renders the a11y blockquote', () => { | ||
const wrapper = shallow(<Blockquote type="ally" />); | ||
expect(wrapper.find('.site-blockquote_ally').length).toEqual(1); | ||
}); | ||
|
||
it('Renders the warning blockquote', () => { | ||
const wrapper = shallow(<Blockquote type="warning" />); | ||
expect(wrapper.find('.site-blockquote_warning').length).toEqual(1); | ||
}); | ||
|
||
it('Renders a header in the blockquote', () => { | ||
const wrapper = shallow(<Blockquote header="Some header text goes here" />); | ||
expect(wrapper.find('.lead').length).toEqual(1); | ||
}); | ||
}); |
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.