Skip to content
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: 2 additions & 2 deletions src/molecules/dropdown-button/dropdown-button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe("DropdownButton", () => {
size={testButtonSize}
/>
);
const result = container.getElementsByClassName(testButtonSize);
const result = container.getElementsByClassName(`-${testButtonSize}`);

// Assert
expect(result).toHaveLength(1);
Expand All @@ -75,7 +75,7 @@ describe("DropdownButton", () => {
style={testButtonStyle}
/>
);
const result = container.getElementsByClassName(testButtonStyle);
const result = container.getElementsByClassName(`-${testButtonStyle}`);

// Assert
expect(result).toHaveLength(1);
Expand Down
4 changes: 2 additions & 2 deletions src/molecules/dropdown-button/dropdown-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ const DropdownButton: React.FC<DropdownButtonProps> = (
}

if (size != null) {
classNames.push(size);
classNames.push(`-${size}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were the ButtonSize and ButtonStyle enums changed? Just curious about this - not saying it should change back, if so. I believe we have been trying to move away from coupling the class name to the enum representation

Copy link
Copy Markdown
Contributor Author

@SaidShah SaidShah Nov 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the ButtonSize and ButtonStyle enums were not changed. They are being used in many places but the issue was all the other places were using (-${size}) as opposed to (size), and same goes for style. That is also how they are being given styles through the CSS.

}

if (style != null) {
classNames.push(style);
classNames.push(`-${style}`);
}

return (
Expand Down