Skip to content

Commit bd8b0b3

Browse files
committed
feat: add missing 'open' and 'weak' entries to ICONS constant
- Add 'open': 'icon-smile-o' and 'weak': 'icon-meh-o' to ICONS mapping - Update test to include the new icon entries
1 parent 90c1968 commit bd8b0b3

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

src/components/__tests__/utils.test.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import moment from 'moment';
2-
import {
3-
QUALITIES,
4-
COLORS,
5-
ICONS,
6-
statusBarClassName,
7-
getQualityObservation,
8-
calculateGroups,
9-
getCurrentSeason
1+
import {
2+
QUALITIES,
3+
COLORS,
4+
ICONS,
5+
statusBarClassName,
6+
getQualityObservation,
7+
calculateGroups,
8+
getCurrentSeason
109
} from '../utils';
1110
import { Unit, UnitObservation } from '../../types';
1211

@@ -59,7 +58,7 @@ describe('Utils', () => {
5958
});
6059

6160
it('should have correct ICONS mapping', () => {
62-
expect(ICONS).toEqual(expect.objectContaining({
61+
expect(ICONS).toEqual({
6362
good: 'icon-smile-o',
6463
satisfactory: 'icon-meh-o',
6564
poor: 'icon-frown-o',
@@ -72,8 +71,10 @@ describe('Utils', () => {
7271
frozen: 'icon-frozen',
7372
plowed: 'icon-plowed',
7473
freezing_started: 'icon-started',
74+
open: 'icon-smile-o',
75+
weak: 'icon-meh-o',
7576
unknown: 'icon-question'
76-
}));
77+
});
7778
});
7879
});
7980

src/components/utils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import _ from 'lodash';
33
import { Unit, UnitObservation } from '../types';
44

55
export const QUALITIES: readonly string[] = [
6-
'good', 'satisfactory', 'unusable', 'unknown', 'warning'
6+
'good',
7+
'satisfactory',
8+
'unusable',
9+
'unknown',
10+
'warning'
711
];
812

913
export const COLORS: Record<string, string> = {
@@ -25,6 +29,8 @@ export const ICONS: Record<string, string> = {
2529
frozen: 'icon-frozen',
2630
plowed: 'icon-plowed',
2731
freezing_started: 'icon-started',
32+
open: 'icon-smile-o',
33+
weak: 'icon-meh-o',
2834
unknown: 'icon-question'
2935
};
3036

0 commit comments

Comments
 (0)