Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit e39f3bd

Browse files
Fix typo
1 parent 64ac297 commit e39f3bd

File tree

3 files changed

+10
-47
lines changed

3 files changed

+10
-47
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
66
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.3.1] - 2023-03-10
9+
10+
## Changed
11+
12+
- fixed a typo in `KeywordSearchWidget`
13+
814
## [3.3.0] - 2023-03-09
915

1016
## Changed

cypress/component/KeywordSearchWidget.cy.tsx

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -323,51 +323,6 @@ describe('<KeywordSearchWidget />', () => {
323323
'aria-checked',
324324
'false'
325325
)
326-
327-
cy.log('Re-render with new props, providing a default selection.')
328-
cy.findByText('Land (cryosphere)').click()
329-
cy.findByText('Atmosphere (physical)').click()
330-
cy.findByText('Global').click()
331-
332-
rerender(
333-
<KeywordSearchWidget
334-
defaultSelections={{
335-
'Spatial coverage': ['Global'],
336-
'Variable domain': ['Atmosphere (composition)', 'Land (cryosphere)']
337-
}}
338-
categories={[
339-
{
340-
category: 'Spatial coverage',
341-
groups: {
342-
Global: 27,
343-
Europe: 12
344-
}
345-
},
346-
{
347-
category: 'Temporal coverage',
348-
groups: {
349-
Past: 18
350-
}
351-
},
352-
{
353-
category: 'Variable domain',
354-
groups: {
355-
'Atmosphere (composition)': 12,
356-
'Atmosphere (physical)': 22,
357-
'Land (cryosphere)': 12
358-
}
359-
}
360-
]}
361-
/>
362-
)
363-
364-
cy.findByLabelText('Atmosphere (physical)').should(
365-
'have.attr',
366-
'aria-checked',
367-
'false'
368-
)
369-
370-
cy.findByLabelText('Global').should('have.attr', 'aria-checked', 'false')
371326
})
372327
})
373328

src/widgets/KeywordSearchWidget.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ const KeywordSearchWidget = ({
6767
selections[keywordCategory?.category]?.length
6868
) {
6969
nextState[keywordCategory.category] = [
70-
...new Set(defaultSelections[keywordCategory.category]),
71-
...new Set(selections[keywordCategory.category])
70+
...new Set([
71+
...defaultSelections[keywordCategory.category],
72+
...selections[keywordCategory.category]
73+
])
7274
]
7375
return nextState
7476
}

0 commit comments

Comments
 (0)