API & Client - add wind direction to workout detail - fix #134
This commit is contained in:
23
fittrackee_client/tests/unit/utils/weather.spec.ts
Normal file
23
fittrackee_client/tests/unit/utils/weather.spec.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { convertDegreeToDirection } from '@/utils/weather'
|
||||
|
||||
describe('convertDegreeToDirection', () => {
|
||||
const testsParams: [number, string][] = [
|
||||
[0, 'N'],
|
||||
[45, 'NE'],
|
||||
[90, 'E'],
|
||||
[135, 'SE'],
|
||||
[180, 'S'],
|
||||
[225, 'SW'],
|
||||
[270, 'W'],
|
||||
[315, 'NW'],
|
||||
[22, 'NNE'],
|
||||
[359, 'N'],
|
||||
]
|
||||
testsParams.map((testParams) => {
|
||||
it(`convert ${testParams[0]}° to ${testParams[1]}`, () => {
|
||||
assert.equal(convertDegreeToDirection(testParams[0]), testParams[1])
|
||||
})
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user