-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed jest config, tests, and update gitigore
- Loading branch information
Showing
18 changed files
with
345 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,6 @@ typings/ | |
|
||
# package.lock.json | ||
package-lock.json | ||
yarn.lock | ||
build/ | ||
|
||
# IDE files | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import { | ||
addPunctuationToNumbers, | ||
generateChartJsOptions, | ||
} from '../utils/chartJs'; | ||
|
||
it('Options with yLabel', () => { | ||
const yLabel = 'foo'; | ||
const options = generateChartJsOptions('', yLabel); | ||
expect(options).toStrictEqual({ | ||
maintainAspectRatio: false, | ||
scales: { | ||
xAxes: [ | ||
{ | ||
bounds: 'ticks', | ||
ticks: { | ||
max: undefined, | ||
min: undefined, | ||
}, | ||
time: { displayFormats: { hour: 'MMM D' } }, | ||
type: 'time', | ||
}, | ||
], | ||
yAxes: [ | ||
{ | ||
scaleLabel: { display: true, labelString: yLabel }, | ||
ticks: { | ||
callback: options.scales.yAxes[0].ticks.callback, | ||
beginAtZero: false, | ||
reverse: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
}); | ||
}); | ||
|
||
it('Option with higher is better', () => { | ||
const options = generateChartJsOptions({ lower_is_better: false }); | ||
expect(options).toStrictEqual({ | ||
maintainAspectRatio: false, | ||
scales: { | ||
xAxes: [ | ||
{ | ||
bounds: 'ticks', | ||
ticks: { | ||
max: undefined, | ||
min: undefined, | ||
}, | ||
time: { displayFormats: { hour: 'MMM D' } }, | ||
type: 'time', | ||
}, | ||
], | ||
yAxes: [ | ||
{ | ||
scaleLabel: { display: true, labelString: 'Score' }, | ||
ticks: { | ||
callback: options.scales.yAxes[0].ticks.callback, | ||
beginAtZero: false, | ||
reverse: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
}); | ||
}); | ||
|
||
it('Option with lower is better', () => { | ||
const options = generateChartJsOptions({ lower_is_better: true }); | ||
expect(options).toStrictEqual({ | ||
maintainAspectRatio: false, | ||
scales: { | ||
xAxes: [ | ||
{ | ||
bounds: 'ticks', | ||
ticks: { | ||
max: undefined, | ||
min: undefined, | ||
}, | ||
time: { displayFormats: { hour: 'MMM D' } }, | ||
type: 'time', | ||
}, | ||
], | ||
yAxes: [ | ||
{ | ||
scaleLabel: { display: true, labelString: 'Execution time (ms)' }, | ||
ticks: { | ||
callback: options.scales.yAxes[0].ticks.callback, | ||
beginAtZero: false, | ||
reverse: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
}); | ||
}); | ||
|
||
it('Tests that numbers are added commas and numbers', () => { | ||
expect(addPunctuationToNumbers('1000000')).toStrictEqual('1,000,000'); | ||
expect(addPunctuationToNumbers('1000')).toStrictEqual('1,000'); | ||
expect(addPunctuationToNumbers('5.20')).toStrictEqual('5.20'); | ||
expect(addPunctuationToNumbers('5')).toStrictEqual('5'); | ||
}); |
4 changes: 2 additions & 2 deletions
4
_tests_/components/Pickers.test.jsx → src/_tests_/components/Pickers.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.