|
| 1 | +const TARGETS_DEFAULT_CONFIG = [ |
| 2 | + { |
| 3 | + id: 'count_no_goal', |
| 4 | + type: 'count', |
| 5 | + title: 'count no goal', |
| 6 | + aggregate: true, |
| 7 | + subtitle_translation_key: 'targets.all_time.subtitle' |
| 8 | + }, |
| 9 | + { |
| 10 | + id: 'count_with_goal', |
| 11 | + type: 'count', |
| 12 | + title: 'count with goal', |
| 13 | + goal: 20, |
| 14 | + aggregate: true, |
| 15 | + subtitle_translation_key: 'targets.all_time.subtitle' |
| 16 | + }, |
| 17 | + { |
| 18 | + id: 'percent_no_goal', |
| 19 | + type: 'percent', |
| 20 | + title: 'percent no goal', |
| 21 | + aggregate: true, |
| 22 | + subtitle_translation_key: 'targets.all_time.subtitle' |
| 23 | + }, |
| 24 | + { |
| 25 | + id: 'percent_with_goal', |
| 26 | + type: 'percent', |
| 27 | + title: 'percent with goal', |
| 28 | + aggregate: true, goal: 80, |
| 29 | + subtitle_translation_key: 'targets.this_month.subtitle' |
| 30 | + }, |
| 31 | + { |
| 32 | + id: 'percent_achieved', |
| 33 | + type: 'percent', |
| 34 | + title: 'percent achieved', |
| 35 | + aggregate: true, goal: 10, |
| 36 | + subtitle_translation_key: 'targets.this_month.subtitle' |
| 37 | + }, |
| 38 | +]; |
| 39 | + |
| 40 | +const TARGETS_CONFIG_WITH_AND_WITHOUT_AGGREGATES = [ |
| 41 | + { id: 'not_aggregate', type: 'count', title: 'my task' }, |
| 42 | + { id: 'also_not_aggregate', type: 'count', title: 'my task' }, |
| 43 | + { id: 'also_also_not_aggregate', type: 'count', title: 'my task', aggregate: false }, |
| 44 | + ...TARGETS_DEFAULT_CONFIG |
| 45 | +]; |
| 46 | + |
| 47 | +const EXPECTED_DEFAULTS_TARGETS = [ |
| 48 | + { id: 'count_no_goal', title: 'count no goal', progressBar: false, goal: false, counter: '25' }, |
| 49 | + { id: 'count_with_goal', title: 'count with goal', progressBar: true, goal: 20, counter: '0 of 5' }, |
| 50 | + { id: 'percent_no_goal', title: 'percent no goal', progressBar: true, goal: false, counter: '50%' }, |
| 51 | + { id: 'percent_with_goal', title: 'percent with goal', progressBar: true, goal: '80%', counter: '5 of 5' }, |
| 52 | + { id: 'percent_achieved', title: 'percent achieved', progressBar: true, goal: '10%', counter: '5 of 5' }, |
| 53 | +]; |
| 54 | + |
| 55 | +const EXPECTED_TARGETS_NO_PROGRESS = [ |
| 56 | + { id: 'count_no_goal', title: 'count no goal', counter: '0', progressBar: false, goal: false }, |
| 57 | + { id: 'count_with_goal', title: 'count with goal', counter: '0 of 5', progressBar: true, goal: 20 }, |
| 58 | + { id: 'percent_no_goal', title: 'percent no goal', counter: '0%', progressBar: true, goal: false }, |
| 59 | + { id: 'percent_with_goal', title: 'percent with goal', counter: '0 of 5', progressBar: true, goal: '80%' }, |
| 60 | + { id: 'percent_achieved', title: 'percent achieved', counter: '0 of 5', progressBar: true, goal: '10%', }, |
| 61 | +]; |
| 62 | + |
| 63 | +module.exports = { |
| 64 | + TARGETS_DEFAULT_CONFIG, |
| 65 | + TARGETS_CONFIG_WITH_AND_WITHOUT_AGGREGATES, |
| 66 | + EXPECTED_DEFAULTS_TARGETS, |
| 67 | + EXPECTED_TARGETS_NO_PROGRESS, |
| 68 | +}; |
0 commit comments