|
7 | 7 |
|
8 | 8 | import React from 'react'; |
9 | 9 | import { render } from 'garden-test-utils'; |
10 | | -import { getColor, DEFAULT_THEME } from '@zendeskgarden/react-theming'; |
| 10 | +import { DEFAULT_THEME, PALETTE } from '@zendeskgarden/react-theming'; |
11 | 11 |
|
12 | 12 | import { StyledStatusIndicator } from './StyledStatusIndicator'; |
13 | 13 |
|
@@ -94,54 +94,48 @@ describe('StyledStatusIndicator', () => { |
94 | 94 | describe('away', () => { |
95 | 95 | it('renders away style', () => { |
96 | 96 | const { container } = render(<StyledStatusIndicator $type="away" />); |
97 | | - const color = getColor({ hue: 'orange', shade: 500, theme: DEFAULT_THEME }); |
98 | 97 |
|
99 | | - expect(container.firstChild).toHaveStyleRule('background-color', color); |
| 98 | + expect(container.firstChild).toHaveStyleRule('background-color', PALETTE.orange[500]); |
100 | 99 | }); |
101 | 100 | }); |
102 | 101 |
|
103 | 102 | describe('transfers', () => { |
104 | 103 | it('renders transfers style', () => { |
105 | 104 | const { container } = render(<StyledStatusIndicator $type="transfers" />); |
106 | | - const color = getColor({ hue: 'azure', shade: 500, theme: DEFAULT_THEME }); |
107 | 105 |
|
108 | | - expect(container.firstChild).toHaveStyleRule('background-color', color); |
| 106 | + expect(container.firstChild).toHaveStyleRule('background-color', PALETTE.azure[500]); |
109 | 107 | }); |
110 | 108 | }); |
111 | 109 |
|
112 | 110 | describe('active', () => { |
113 | 111 | it('renders active style', () => { |
114 | 112 | const { container } = render(<StyledStatusIndicator $type="active" />); |
115 | | - const color = getColor({ hue: 'crimson', shade: 700, theme: DEFAULT_THEME }); |
116 | 113 |
|
117 | 114 | expect(container.firstChild).toHaveStyleRule('height', '16px'); |
118 | | - expect(container.firstChild).toHaveStyleRule('background-color', color); |
| 115 | + expect(container.firstChild).toHaveStyleRule('background-color', PALETTE.crimson[700]); |
119 | 116 | }); |
120 | 117 |
|
121 | 118 | it('renders active style with small size', () => { |
122 | 119 | const { container } = render(<StyledStatusIndicator $type="active" $size="small" />); |
123 | | - const color = getColor({ hue: 'crimson', shade: 700, theme: DEFAULT_THEME }); |
124 | 120 |
|
125 | 121 | expect(container.firstChild).toHaveStyleRule('height', '12px'); |
126 | | - expect(container.firstChild).toHaveStyleRule('background-color', color); |
| 122 | + expect(container.firstChild).toHaveStyleRule('background-color', PALETTE.crimson[700]); |
127 | 123 | }); |
128 | 124 | }); |
129 | 125 |
|
130 | 126 | describe('available', () => { |
131 | 127 | it('renders available style', () => { |
132 | 128 | const { container } = render(<StyledStatusIndicator $type="available" />); |
133 | | - const color = getColor({ hue: 'mint', shade: 500, theme: DEFAULT_THEME }); |
134 | 129 |
|
135 | | - expect(container.firstChild).toHaveStyleRule('background-color', color); |
| 130 | + expect(container.firstChild).toHaveStyleRule('background-color', PALETTE.mint[500]); |
136 | 131 | }); |
137 | 132 | }); |
138 | 133 |
|
139 | 134 | describe('offline', () => { |
140 | 135 | it('renders offline style', () => { |
141 | 136 | const { container } = render(<StyledStatusIndicator $type="offline" />); |
142 | | - const color = getColor({ hue: 'grey', shade: 500, theme: DEFAULT_THEME }); |
143 | 137 |
|
144 | | - expect(container.firstChild).toHaveStyleRule('border-color', `${color}`); |
| 138 | + expect(container.firstChild).toHaveStyleRule('border-color', PALETTE.grey[500]); |
145 | 139 | }); |
146 | 140 | }); |
147 | 141 | }); |
|
0 commit comments