Skip to content

Commit a054e5a

Browse files
committed
Fix tests.
1 parent 7cde747 commit a054e5a

3 files changed

Lines changed: 23 additions & 28 deletions

File tree

src/components/tabs/__snapshots__/tabs.test.js.snap

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,62 +17,60 @@ exports[`Tabs states * should render uncontrolled 1`] = `
1717
justify-content: start;
1818
padding: 0 2px;
1919
color: #526161;
20-
border-bottom: 1px solid #DBE1E1;
20+
border-bottom: 1px solid #E4E8E8;
2121
}
2222
2323
.c2 {
2424
display: flex;
25-
flex: 1 0 auto;
2625
flex-direction: row;
2726
align-items: center;
2827
justify-content: center;
28+
padding: 0 24px;
2929
color: #526161;
3030
}
3131
3232
.c3 {
3333
white-space: nowrap;
34-
border-bottom: 4px solid #42B861;
34+
border-bottom: 1px solid #42B861;
3535
box-sizing: border-box;
36-
min-width: 80px;
36+
border-radius: 4px 4px 0 0;
3737
max-width: 208px;
38-
height: 48px;
39-
color: #526161;
40-
font-weight: bold;
38+
height: 32px;
4139
cursor: pointer;
4240
opacity: 1;
43-
background: transparent;
41+
background: #F1FFF7;
4442
pointer-events: auto;
43+
margin-bottom: -1px;
4544
}
4645
4746
.c3:hover {
48-
border-bottom: 4px solid #00AB44;
47+
border-bottom: 1px solid #00AB44;
4948
}
5049
5150
.c3>span {
52-
font-weight: bold;
51+
color: #00AB44;
5352
}
5453
5554
.c4 {
5655
white-space: nowrap;
57-
border-bottom: 4px solid rgba(255,255,255,0.0);
56+
border-bottom: 1px solid #E4E8E8;
5857
box-sizing: border-box;
59-
min-width: 80px;
58+
border-radius: 4px 4px 0 0;
6059
max-width: 208px;
61-
height: 48px;
62-
color: #526161;
63-
font-weight: normal;
60+
height: 32px;
6461
cursor: pointer;
6562
opacity: 1;
66-
background: transparent;
63+
background: #F6F7F7;
6764
pointer-events: auto;
65+
margin-bottom: -1px;
6866
}
6967
7068
.c4:hover {
71-
border-bottom: 4px solid #00AB44;
69+
border-bottom: 1px solid #00AB44;
7270
}
7371
7472
.c4>span {
75-
font-weight: normal;
73+
color: #708585;
7674
}
7775
7876
<div
@@ -88,36 +86,36 @@ exports[`Tabs states * should render uncontrolled 1`] = `
8886
<div
8987
alignitems="center"
9088
class="c2 c3"
91-
flex="grow"
9289
justifycontent="center"
9390
label="hi"
91+
padding="0,6"
9492
>
9593
hi
9694
</div>
9795
<div
9896
alignitems="center"
9997
class="c2 c4"
100-
flex="grow"
10198
justifycontent="center"
10299
label="Hi again"
100+
padding="0,6"
103101
>
104102
Hi again
105103
</div>
106104
<div
107105
alignitems="center"
108106
class="c2 c4"
109-
flex="grow"
110107
justifycontent="center"
111108
label="Bye"
109+
padding="0,6"
112110
>
113111
Bye
114112
</div>
115113
<div
116114
alignitems="center"
117115
class="c2 c4"
118-
flex="grow"
119116
justifycontent="center"
120117
label="Bye Bye"
118+
padding="0,6"
121119
>
122120
Bye Bye
123121
</div>

src/components/tabs/tabs.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ describe("Tabs states", () => {
2020
const tabs = container.firstChild
2121
expect(tabs).toMatchSnapshot()
2222

23-
expect(getByText("hi")).toHaveStyleRule("font-weight", "bold")
2423
expect(queryByText("Hello")).toBeInTheDocument()
2524
expect(queryByText("Hello again")).not.toBeInTheDocument()
2625
expect(queryByText("Goodbye")).not.toBeInTheDocument()
2726
expect(queryByText("Fairwell")).not.toBeInTheDocument()
2827

2928
const tab = getByText("Bye Bye")
3029
fireEvent.click(tab)
31-
expect(tab).toHaveStyleRule("font-weight", "bold")
30+
3231
expect(queryByText("Hello")).not.toBeInTheDocument()
3332
expect(queryByText("Fairwell")).toBeInTheDocument()
3433
})
@@ -55,13 +54,11 @@ describe("Tabs states", () => {
5554

5655
expect(queryByText("Hello")).not.toBeInTheDocument()
5756
expect(queryByText("Hello again")).not.toBeInTheDocument()
58-
expect(getByText("Bye")).toHaveStyleRule("font-weight", "bold")
5957
expect(queryByText("Goodbye")).toBeInTheDocument()
6058
expect(queryByText("Fairwell")).not.toBeInTheDocument()
6159

6260
const tab = getByText("Hi again")
6361
fireEvent.click(tab)
64-
expect(tab).toHaveStyleRule("font-weight", "bold")
6562
expect(onChange).toBeCalledWith(1)
6663
expect(queryByText("Goodbye")).not.toBeInTheDocument()
6764
expect(queryByText("Hello again")).toBeInTheDocument()
@@ -81,12 +78,10 @@ describe("Tabs states", () => {
8178
const { queryByText, getByText } = renderWithProviders(<Component />)
8279

8380
expect(queryByText("Hello")).not.toBeInTheDocument()
84-
expect(getByText("Hi again")).toHaveStyleRule("font-weight", "bold")
8581
expect(queryByText("Hello again")).toBeInTheDocument()
8682

8783
const tab = getByText("hi")
8884
fireEvent.click(tab)
89-
expect(tab).toHaveStyleRule("font-weight", "normal")
9085
expect(queryByText("Hello")).not.toBeInTheDocument()
9186
expect(queryByText("Hello again")).toBeInTheDocument()
9287
})

src/components/templates/mixins/height.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ it("renders min max", () => {
1414
expect(height({ theme, height: { min: "20rem", max: "45rem" } })).toBe(`
1515
min-height: 20rem;
1616
max-height: 45rem;
17+
1718
`)
1819
expect(height({ theme, height: { min: 1, max: 2 } })).toBe(`
1920
min-height: 4px;
2021
max-height: 8px;
22+
2123
`)
2224
})
2325

0 commit comments

Comments
 (0)