Skip to content

Commit 7d3662f

Browse files
committed
💚 Fix failed tests on toggle and tooltip
1 parent 5c1b33c commit 7d3662f

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

lib/snackbar/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ class Snackbar extends React.Component {
8686
className={classnames(
8787
theme.snackbarWrapper,
8888
theme[position],
89-
active ? theme.active : '',
89+
position,
90+
active ? `${theme.active} active` : '',
9091
)}
9192
>
9293
<div className={classes}>{children}</div>

lib/table/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ class Table extends React.Component {
5555
<span
5656
className={
5757
(isCurrentKey && this.state[`${key}Ascending`])
58-
? theme.sortedAscending
58+
? `${theme.sortedAscending} sortedAscending`
5959
: null
6060
}
6161
onClick={() => this.sortAscending(key)}
6262
/>
6363
<span
6464
className={
6565
(isCurrentKey && this.state[`${key}Descending`])
66-
? theme.sortedDescending
66+
? `${theme.sortedDescending} sortedDescending`
6767
: null
6868
}
6969
onClick={() => this.sortDescending(key)}

lib/toggle/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const Toggle = ({
2626
type="checkbox"
2727
name={label} // when name prop isn't passed, name sets to same value as label prop
2828
onClick={() => onClick(label, value)}
29+
className="toggle-item"
2930
{...props}
3031
/>
3132
</label>

lib/toggle/tests/render.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ describe('Render Toggle Component tests', () => {
2929
expect(actualValue()).equal(expectedValue);
3030
});
3131

32-
it('Should have a span with className toggle-item', () => {
32+
it('Should have a input with className toggle-item', () => {
3333
expectedValue = true;
34-
actualValue = () => wrappedComponent.find('span').hasClass('toggle-item');
34+
actualValue = () => wrappedComponent.find('input').hasClass('toggle-item');
3535
expect(actualValue()).to.equal(expectedValue);
3636
});
3737
});

lib/tooltip/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Tooltip extends React.Component {
4343
{
4444
this.state.tooltipActive && (
4545
<div className={theme.tip} id="tip">
46-
<div className={classnames(theme.tooltipContent, { [theme.top]: top })}>
46+
<div className={classnames(theme.tooltipContent, (top ? `${theme.top} top` : ''))}>
4747
{tooltipText}
4848
</div>
4949
</div>

0 commit comments

Comments
 (0)