Skip to content

Commit 213ad3f

Browse files
committed
fix(Button): Some more test cases added
1 parent 1e82bb0 commit 213ad3f

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@
1212
"config": {},
1313
"size-limit": [
1414
{
15-
<<<<<<< HEAD
1615
"limit": "40 KB",
17-
=======
18-
"limit": "36 KB",
19-
>>>>>>> b4845c46416a6db3ed1ea5a46f75eb1146ec4cff
2016
"webpack": false,
2117
"path": "dist/**/!(*.test).js"
2218
}

src/components/Button/__tests__/Button.test.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,28 @@ describe('Button', () => {
7676
expect(component.find('Button').last().prop('color')).toEqual('default');
7777
});
7878

79+
it('should pass the color as "default" when no color is given', async () => {
80+
const component = mount(
81+
<BlueBaseApp plugins={[Plugin]}>
82+
<Button />
83+
</BlueBaseApp>
84+
);
85+
await waitForElement(component, Button);
86+
87+
expect(component.find('Button').last().prop('color')).toEqual('primary');
88+
});
89+
90+
it('should pass the color as given', async () => {
91+
const component = mount(
92+
<BlueBaseApp plugins={[Plugin]}>
93+
<Button color={'#000000'}/>
94+
</BlueBaseApp>
95+
);
96+
await waitForElement(component, Button);
97+
expect(component.find('Button').last().prop('color')).toBeDefined();
98+
});
99+
100+
79101
it('should loading the button when loading is true ', async () => {
80102
const component = mount(
81103
<BlueBaseApp plugins={[Plugin]}>

0 commit comments

Comments
 (0)