agroptima-design-system 0.25.3 → 0.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/atoms/Select.tsx
CHANGED
|
@@ -113,6 +113,7 @@ describe('Multiselect', () => {
|
|
|
113
113
|
expect(getByText(/error2/i)).toBeInTheDocument()
|
|
114
114
|
})
|
|
115
115
|
it('clears options selected', async () => {
|
|
116
|
+
const mockChange = jest.fn()
|
|
116
117
|
const user = userEvent.setup()
|
|
117
118
|
const placeholder = 'Select your favourite videogames...'
|
|
118
119
|
const { getByText } = render(
|
|
@@ -137,6 +138,7 @@ describe('Multiselect', () => {
|
|
|
137
138
|
placeholder={placeholder}
|
|
138
139
|
defaultValue={['2', '1']}
|
|
139
140
|
selectedLabel="videogames selected"
|
|
141
|
+
onChange={mockChange}
|
|
140
142
|
variant="primary"
|
|
141
143
|
/>,
|
|
142
144
|
)
|
|
@@ -144,5 +146,6 @@ describe('Multiselect', () => {
|
|
|
144
146
|
await user.click(screen.getByRole('button', { name: /close/i }))
|
|
145
147
|
|
|
146
148
|
expect(getByText(placeholder)).toBeInTheDocument()
|
|
149
|
+
expect(mockChange).toHaveBeenCalledWith([])
|
|
147
150
|
})
|
|
148
151
|
})
|
package/tests/Select.spec.tsx
CHANGED
|
@@ -119,6 +119,7 @@ describe('Select', () => {
|
|
|
119
119
|
expect(getByText(/error2/i)).toBeInTheDocument()
|
|
120
120
|
})
|
|
121
121
|
it('clears option selected', async () => {
|
|
122
|
+
const mockChange = jest.fn()
|
|
122
123
|
const user = userEvent.setup()
|
|
123
124
|
const placeholder = 'Select your favourite gaming system...'
|
|
124
125
|
const { getByText } = render(
|
|
@@ -143,6 +144,7 @@ describe('Select', () => {
|
|
|
143
144
|
},
|
|
144
145
|
]}
|
|
145
146
|
placeholder={placeholder}
|
|
147
|
+
onChange={mockChange}
|
|
146
148
|
variant="primary"
|
|
147
149
|
/>,
|
|
148
150
|
)
|
|
@@ -150,5 +152,6 @@ describe('Select', () => {
|
|
|
150
152
|
await user.click(screen.getByRole('button', { name: /close/i }))
|
|
151
153
|
|
|
152
154
|
expect(getByText(placeholder)).toBeInTheDocument()
|
|
155
|
+
expect(mockChange).toHaveBeenCalledWith('')
|
|
153
156
|
})
|
|
154
157
|
})
|