Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds consistency in style API between ClayDropdown and ClayDropdownBase | Fixes #874 #898

Merged
merged 3 commits into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/clay-dropdown/src/ClayDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ ClayDropdown.STATE = {
* @memberof ClayDropdown
* @type {?string}
*/
style: Config.oneOf(['secondary', 'unstyled']).value('unstyled'),
style: Config.oneOf(['link', 'primary', 'secondary', 'unstyled']).value(
'unstyled'
),

/**
* CSS classes to be applied to the trigger element.
Expand Down
43 changes: 43 additions & 0 deletions packages/clay-dropdown/src/__tests__/ClayDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,49 @@ describe('ClayDropdown', function() {
expect(clayDropdown).toMatchSnapshot();
});

it('should render a dropdown with the `link` style', () => {
clayDropdown = new ClayDropdown({
items: items,
label: 'Trigger',
spritemap: 'icons.svg',
style: 'link',
});

expect(clayDropdown).toMatchSnapshot();
});

it('should render a dropdown with the `primary` style', () => {
clayDropdown = new ClayDropdown({
items: items,
label: 'Trigger',
spritemap: 'icons.svg',
style: 'primary',
});

expect(clayDropdown).toMatchSnapshot();
});

it('should render a dropdown with the `secondary` style', () => {
clayDropdown = new ClayDropdown({
items: items,
label: 'Trigger',
spritemap: 'icons.svg',
style: 'secondary',
});

expect(clayDropdown).toMatchSnapshot();
});

it('should render a dropdown with the `unstyled` style by default', () => {
clayDropdown = new ClayDropdown({
items: items,
label: 'Trigger',
spritemap: 'icons.svg',
});

expect(clayDropdown).toMatchSnapshot();
});

it('should render a dropdown with trigger custom classes', () => {
clayDropdown = new ClayDropdown({
items: items,
Expand Down
Loading