@@ -147,16 +147,16 @@
import UserPicture from '@/components/User/UserPicture.vue'
import { ROOT_STORE } from '@/store/constants'
import type { ISport } from '@/types/sports'
- import type { IUserProfile } from '@/types/user'
+ import type { IAuthUserProfile } from '@/types/user'
import type { IWorkout } from '@/types/workouts'
import { useStore } from '@/use/useStore'
import { formatDate } from '@/utils/dates'
interface Props {
- user: IUserProfile
+ user: IAuthUserProfile
useImperialUnits: boolean
workout?: IWorkout
- sport?: ISport
+ sport?: ISport | null
}
const props = withDefaults(defineProps
(), {
workout: () => ({}) as IWorkout,
diff --git a/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutNotes.vue b/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutNotes.vue
index 99514436..79cbe425 100644
--- a/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutNotes.vue
+++ b/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutNotes.vue
@@ -24,7 +24,7 @@
notes?: string | null
}
const props = withDefaults(defineProps(), {
- notes: () => null,
+ notes: () => '',
})
const { notes } = toRefs(props)
diff --git a/fittrackee_client/src/components/Workout/WorkoutDetail/index.vue b/fittrackee_client/src/components/Workout/WorkoutDetail/index.vue
index 30dfaed7..69b48ced 100644
--- a/fittrackee_client/src/components/Workout/WorkoutDetail/index.vue
+++ b/fittrackee_client/src/components/Workout/WorkoutDetail/index.vue
@@ -11,6 +11,7 @@
sport.id === props.workoutData.workout.sport_id
)
- : {}
+ : ({} as ISport)
)
const workoutObject = computed(() =>
getWorkoutObject(workout.value, segment.value)
diff --git a/fittrackee_client/src/components/Workout/WorkoutEdition.vue b/fittrackee_client/src/components/Workout/WorkoutEdition.vue
index 7c359427..26dc9fcd 100644
--- a/fittrackee_client/src/components/Workout/WorkoutEdition.vue
+++ b/fittrackee_client/src/components/Workout/WorkoutEdition.vue
@@ -281,12 +281,12 @@
import { ROOT_STORE, WORKOUTS_STORE } from '@/store/constants'
import type { TAppConfig } from '@/types/application'
- import type { ISport } from '@/types/sports'
+ import type { ISport, ITranslatedSport } from '@/types/sports'
import type { IAuthUserProfile } from '@/types/user'
import type { IWorkout, IWorkoutForm } from '@/types/workouts'
import { useStore } from '@/use/useStore'
import { formatWorkoutDate, getDateWithTZ } from '@/utils/dates'
- import { getReadableFileSize } from '@/utils/files'
+ import { getReadableFileSizeAsText } from '@/utils/files'
import { translateSports } from '@/utils/sports'
import { convertDistance } from '@/utils/units'
@@ -308,7 +308,7 @@
const router = useRouter()
const { authUser, workout, isCreation, loading } = toRefs(props)
- const translatedSports: ComputedRef = computed(() =>
+ const translatedSports: ComputedRef = computed(() =>
translateSports(
props.sports,
t,
@@ -320,11 +320,11 @@
() => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]
)
const fileSizeLimit = appConfig.value.max_single_file_size
- ? getReadableFileSize(appConfig.value.max_single_file_size)
+ ? getReadableFileSizeAsText(appConfig.value.max_single_file_size)
: ''
const gpx_limit_import = appConfig.value.gpx_limit_import
const zipSizeLimit = appConfig.value.max_zip_file_size
- ? getReadableFileSize(appConfig.value.max_zip_file_size)
+ ? getReadableFileSizeAsText(appConfig.value.max_zip_file_size)
: ''
const errorMessages: ComputedRef = computed(
() => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]
@@ -369,9 +369,9 @@
withGpx.value = !withGpx.value
formErrors.value = false
}
- function updateFile(event: Event & { target: HTMLInputElement }) {
- if (event.target.files) {
- gpxFile = event.target.files[0]
+ function updateFile(event: Event) {
+ if ((event.target as HTMLInputElement).files) {
+ gpxFile = ((event.target as HTMLInputElement).files as FileList)[0]
}
}
function formatWorkoutForm(workout: IWorkout) {
diff --git a/fittrackee_client/src/components/Workouts/WorkoutsFilters.vue b/fittrackee_client/src/components/Workouts/WorkoutsFilters.vue
index 4d525535..63edf330 100644
--- a/fittrackee_client/src/components/Workouts/WorkoutsFilters.vue
+++ b/fittrackee_client/src/components/Workouts/WorkoutsFilters.vue
@@ -192,7 +192,7 @@
import { useRoute, useRouter } from 'vue-router'
import type { LocationQuery } from 'vue-router'
- import type { ISport } from '@/types/sports'
+ import type { ISport, ITranslatedSport } from '@/types/sports'
import type { IAuthUserProfile } from '@/types/user'
import { translateSports } from '@/utils/sports'
import { units } from '@/utils/units'
@@ -214,7 +214,7 @@
const toUnit = authUser.value.imperial_units
? units['km'].defaultTarget
: 'km'
- const translatedSports: ComputedRef = computed(() =>
+ const translatedSports: ComputedRef = computed(() =>
translateSports(props.sports, t)
)
let params: LocationQuery = Object.assign({}, route.query)
@@ -226,11 +226,13 @@
}
})
- function handleFilterChange(event: Event & { target: HTMLInputElement }) {
- if (event.target.value === '') {
- delete params[event.target.name]
+ function handleFilterChange(event: Event) {
+ const name = (event.target as HTMLInputElement).name
+ const value = (event.target as HTMLInputElement).value
+ if (value === '') {
+ delete params[name]
} else {
- params[event.target.name] = event.target.value
+ params[name] = value
}
}
function onFilter() {
diff --git a/fittrackee_client/src/components/Workouts/WorkoutsList.vue b/fittrackee_client/src/components/Workouts/WorkoutsList.vue
index 6d103b14..807f0234 100644
--- a/fittrackee_client/src/components/Workouts/WorkoutsList.vue
+++ b/fittrackee_client/src/components/Workouts/WorkoutsList.vue
@@ -5,7 +5,7 @@
{{ $t('common.TOTAL').toLowerCase() }}:
-
+
{{ pagination.total }}
{{ $t('workouts.WORKOUT', pagination.total) }}
@@ -47,7 +47,7 @@
& IRootActions = {
},
[ROOT_STORE.ACTIONS.UPDATE_APPLICATION_LANGUAGE](
context: ActionContext,
- language: string
+ language: TLanguage
): void {
document.querySelector('html')?.setAttribute('lang', language)
context.commit(ROOT_STORE.MUTATIONS.UPDATE_LANG, language)
diff --git a/fittrackee_client/src/store/modules/root/mutations.ts b/fittrackee_client/src/store/modules/root/mutations.ts
index 86001def..0fdf7215 100644
--- a/fittrackee_client/src/store/modules/root/mutations.ts
+++ b/fittrackee_client/src/store/modules/root/mutations.ts
@@ -3,6 +3,7 @@ import type { MutationTree } from 'vuex'
import { ROOT_STORE } from '@/store/constants'
import type { IRootState, TRootMutations } from '@/store/modules/root/types'
import type { TAppConfig, IAppStatistics } from '@/types/application'
+import type { TLanguage } from '@/types/locales'
import { localeFromLanguage } from '@/utils/locales'
export const mutations: MutationTree & TRootMutations = {
@@ -40,7 +41,7 @@ export const mutations: MutationTree & TRootMutations = {
) {
state.application.statistics = statistics
},
- [ROOT_STORE.MUTATIONS.UPDATE_LANG](state: IRootState, language: string) {
+ [ROOT_STORE.MUTATIONS.UPDATE_LANG](state: IRootState, language: TLanguage) {
state.language = language
state.locale = localeFromLanguage[language]
},
diff --git a/fittrackee_client/src/store/modules/root/types.ts b/fittrackee_client/src/store/modules/root/types.ts
index 0004286d..8717d1d3 100644
--- a/fittrackee_client/src/store/modules/root/types.ts
+++ b/fittrackee_client/src/store/modules/root/types.ts
@@ -13,10 +13,11 @@ import type {
IAppStatistics,
TAppConfigForm,
} from '@/types/application'
+import type { TLanguage } from '@/types/locales'
export interface IRootState {
root: boolean
- language: string
+ language: TLanguage
locale: Locale
errorMessages: string | string[] | null
application: IApplication
@@ -39,7 +40,7 @@ export interface IRootActions {
): void
[ROOT_STORE.ACTIONS.UPDATE_APPLICATION_LANGUAGE](
context: ActionContext,
- langauge: string
+ language: TLanguage
): void
}
@@ -54,7 +55,7 @@ export interface IRootGetters {
state: IRootState
): string | string[] | null
- [ROOT_STORE.GETTERS.LANGUAGE](state: IRootState): string
+ [ROOT_STORE.GETTERS.LANGUAGE](state: IRootState): TLanguage
[ROOT_STORE.GETTERS.LOCALE](state: IRootState): Locale
}
@@ -81,7 +82,7 @@ export type TRootMutations = {
state: S,
statistics: IAppStatistics
): void
- [ROOT_STORE.MUTATIONS.UPDATE_LANG](state: S, language: string): void
+ [ROOT_STORE.MUTATIONS.UPDATE_LANG](state: S, language: TLanguage): void
}
export type TRootStoreModule = Omit<
diff --git a/fittrackee_client/src/types/application.ts b/fittrackee_client/src/types/application.ts
index 6809f04c..235e3d73 100644
--- a/fittrackee_client/src/types/application.ts
+++ b/fittrackee_client/src/types/application.ts
@@ -37,3 +37,8 @@ export type TAppConfigForm = {
max_zip_file_size: number
privacy_policy: string
}
+
+export interface IFileSize {
+ size: string
+ suffix: string
+}
diff --git a/fittrackee_client/src/types/locales.ts b/fittrackee_client/src/types/locales.ts
new file mode 100644
index 00000000..ecd132aa
--- /dev/null
+++ b/fittrackee_client/src/types/locales.ts
@@ -0,0 +1,10 @@
+export type TLanguage =
+ | 'en'
+ | 'de'
+ | 'es'
+ | 'fr'
+ | 'gl'
+ | 'it'
+ | 'nb'
+ | 'nl'
+ | 'pl'
diff --git a/fittrackee_client/src/types/user.ts b/fittrackee_client/src/types/user.ts
index ce11a65b..87e9009e 100644
--- a/fittrackee_client/src/types/user.ts
+++ b/fittrackee_client/src/types/user.ts
@@ -1,5 +1,6 @@
import type { LocationQueryValue } from 'vue-router'
+import type { TLanguage } from '@/types/locales'
import type { IRecord } from '@/types/workouts'
export interface IUserProfile {
@@ -30,7 +31,7 @@ export interface IAuthUserProfile extends IUserProfile {
imperial_units: boolean
start_elevation_at_zero: boolean
use_raw_gpx_speed: boolean
- language: string | null
+ language: TLanguage | null
timezone: string
date_format: string
weekm: boolean
@@ -68,7 +69,7 @@ export interface IUserPreferencesPayload {
start_elevation_at_zero: boolean
use_raw_gpx_speed: boolean
imperial_units: boolean
- language: string
+ language: TLanguage
timezone: string
date_format: string
weekm: boolean
diff --git a/fittrackee_client/src/types/workouts.ts b/fittrackee_client/src/types/workouts.ts
index a8a5888c..c3f90cc8 100644
--- a/fittrackee_client/src/types/workouts.ts
+++ b/fittrackee_client/src/types/workouts.ts
@@ -34,10 +34,10 @@ export interface IRecord {
}
export interface IRecordsBySport {
- [key: string]: string | Record[] | null
+ [key: string]: string | IRecord[] | null
label: string
color: string | null
- records: Record[]
+ records: IRecord[]
}
export interface IRecordsBySports {
@@ -59,8 +59,8 @@ export interface IWorkout {
bounds: number[]
creation_date: string
descent: number | null
- distance: number | null
- duration: string | null
+ distance: number
+ duration: string
id: string
map: string | null
max_alt: number | null
diff --git a/fittrackee_client/src/utils/dates.ts b/fittrackee_client/src/utils/dates.ts
index d97aa3e5..27743147 100644
--- a/fittrackee_client/src/utils/dates.ts
+++ b/fittrackee_client/src/utils/dates.ts
@@ -12,6 +12,7 @@ import {
import { utcToZonedTime } from 'date-fns-tz'
import createI18n from '@/i18n'
+import type { TLanguage } from '@/types/locales'
import { localeFromLanguage } from '@/utils/locales'
const { locale } = createI18n.global
@@ -114,7 +115,7 @@ export const formatDate = (
timezone: string,
dateFormat: string,
withTime = true,
- language: string | null = null,
+ language: TLanguage | null = null,
withSeconds = false
): string => {
if (!language) {
@@ -131,9 +132,9 @@ export const formatDate = (
export const availableDateFormatOptions = (
inputDate: string,
timezone: string,
- language: string | null = null
+ language: TLanguage | null = null
) => {
- const l: string = language ? language : locale.value
+ const l: TLanguage = language ? language : locale.value
const options: Record[] = []
availableDateFormats.map((df) => {
const dateFormat = getDateFormat(df, l)
diff --git a/fittrackee_client/src/utils/files.ts b/fittrackee_client/src/utils/files.ts
index 814ee0de..208258c4 100644
--- a/fittrackee_client/src/utils/files.ts
+++ b/fittrackee_client/src/utils/files.ts
@@ -1,16 +1,23 @@
+import type { IFileSize } from '@/types/application'
+
const suffixes = ['bytes', 'KB', 'MB', 'GB', 'TB']
-export const getReadableFileSize = (
- fileSize: number,
- asText = true
-): string | Record => {
- const i = Math.floor(Math.log(fileSize) / Math.log(1024))
+export const getReadableFileSize = (fileSize: number): IFileSize => {
if (!fileSize) {
- return asText ? '0 bytes' : { size: '0', suffix: 'bytes' }
+ return { size: '0', suffix: 'bytes' }
}
+ const i = Math.floor(Math.log(fileSize) / Math.log(1024))
const size = (fileSize / Math.pow(1024, i)).toFixed(1)
const suffix = suffixes[i]
- return asText ? `${size}${suffix}` : { size, suffix }
+ return { size, suffix }
+}
+
+export const getReadableFileSizeAsText = (fileSize: number): string => {
+ if (!fileSize) {
+ return '0 bytes'
+ }
+ const readableFileSize = getReadableFileSize(fileSize)
+ return `${readableFileSize.size}${readableFileSize.suffix}`
}
export const getFileSizeInMB = (fileSize: number): number => {
diff --git a/fittrackee_client/src/utils/locales.ts b/fittrackee_client/src/utils/locales.ts
index a706881c..47c7f293 100644
--- a/fittrackee_client/src/utils/locales.ts
+++ b/fittrackee_client/src/utils/locales.ts
@@ -2,20 +2,37 @@ import type { Locale } from 'date-fns'
import { de, enUS, es, fr, gl, it, nb, nl, pl } from 'date-fns/locale'
import createI18n from '@/i18n'
+import type { TLanguage } from '@/types/locales'
-export const localeFromLanguage: Record = {
+export const isLanguageSupported = (
+ language: string
+): language is TLanguage => {
+ return (
+ language === 'de' ||
+ language === 'en' ||
+ language === 'es' ||
+ language === 'fr' ||
+ language === 'gl' ||
+ language === 'it' ||
+ language === 'nb' ||
+ language === 'nl' ||
+ language === 'pl'
+ )
+}
+
+export const localeFromLanguage: Record = {
de: de,
en: enUS,
es: es,
fr: fr,
gl: gl,
it: it,
- pl: pl,
nb: nb,
nl: nl,
+ pl: pl,
}
-export const languageLabels: Record = {
+export const languageLabels: Record = {
de: 'Deutsch',
en: 'English',
es: 'EspaƱol',
diff --git a/fittrackee_client/src/utils/records.ts b/fittrackee_client/src/utils/records.ts
index 75ee2d1e..914a8fd6 100644
--- a/fittrackee_client/src/utils/records.ts
+++ b/fittrackee_client/src/utils/records.ts
@@ -12,7 +12,7 @@ export const formatRecord = (
tz: string,
useImperialUnits: boolean,
date_format: string
-): Record => {
+): IRecord => {
const distanceUnitFrom: TUnit = 'km'
const distanceUnitTo: TUnit = useImperialUnits
? units[distanceUnitFrom].defaultTarget
@@ -57,11 +57,13 @@ export const formatRecord = (
)
}
return {
- workout_date: formatDate(record.workout_date, tz, date_format, false),
- workout_id: record.workout_id,
id: record.id,
record_type: record.record_type,
+ sport_id: record.sport_id,
value: value,
+ user: record.user,
+ workout_date: formatDate(record.workout_date, tz, date_format, false),
+ workout_id: record.workout_id,
}
}
diff --git a/fittrackee_client/src/views/user/PasswordResetView.vue b/fittrackee_client/src/views/user/PasswordResetView.vue
index 87ea37ab..39421c99 100644
--- a/fittrackee_client/src/views/user/PasswordResetView.vue
+++ b/fittrackee_client/src/views/user/PasswordResetView.vue
@@ -27,7 +27,7 @@
const router = useRouter()
const { action } = toRefs(props)
- const token = computed(() => route.query.token)
+ const token = computed(() => route.query.token as string)
onBeforeMount(() => {
if (props.action === 'reset' && !token.value) {
diff --git a/fittrackee_client/tests/unit/utils/files.spec.ts b/fittrackee_client/tests/unit/utils/files.spec.ts
index 8cd4e70a..0c291859 100644
--- a/fittrackee_client/tests/unit/utils/files.spec.ts
+++ b/fittrackee_client/tests/unit/utils/files.spec.ts
@@ -1,8 +1,12 @@
import { describe, it, expect } from 'vitest'
-import { getFileSizeInMB, getReadableFileSize } from '@/utils/files'
+import {
+ getFileSizeInMB,
+ getReadableFileSize,
+ getReadableFileSizeAsText,
+} from '@/utils/files'
-describe('getReadableFileSize (as text)', () => {
+describe('getReadableFileSizeAsText', () => {
const testsParams = [
{
description: 'returns 0 bytes if provided file size is 0',
@@ -23,7 +27,7 @@ describe('getReadableFileSize (as text)', () => {
testsParams.map((testParams) => {
it(testParams.description, () => {
- expect(getReadableFileSize(testParams.inputFileSize, true)).toStrictEqual(
+ expect(getReadableFileSizeAsText(testParams.inputFileSize)).toStrictEqual(
testParams.expectedReadableFileSize
)
})
@@ -51,9 +55,9 @@ describe('getReadableFileSize (as object)', () => {
testsParams.map((testParams) => {
it(testParams.description, () => {
- expect(
- getReadableFileSize(testParams.inputFileSize, false)
- ).toStrictEqual(testParams.expectedReadableFileSize)
+ expect(getReadableFileSize(testParams.inputFileSize)).toStrictEqual(
+ testParams.expectedReadableFileSize
+ )
})
})
})
diff --git a/fittrackee_client/tests/unit/utils/records.spec.ts b/fittrackee_client/tests/unit/utils/records.spec.ts
index bb1645f1..72e9b034 100644
--- a/fittrackee_client/tests/unit/utils/records.spec.ts
+++ b/fittrackee_client/tests/unit/utils/records.spec.ts
@@ -24,6 +24,8 @@ describe('formatRecord', () => {
expected: {
id: 9,
record_type: 'AS',
+ sport_id: 1,
+ user: 'admin',
value: '18 km/h',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -47,6 +49,8 @@ describe('formatRecord', () => {
expected: {
id: 10,
record_type: 'FD',
+ sport_id: 1,
+ user: 'admin',
value: '18 km',
workout_date: '2019/07/08',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -70,6 +74,8 @@ describe('formatRecord', () => {
expected: {
id: 11,
record_type: 'LD',
+ sport_id: 1,
+ user: 'admin',
value: '1:01:00',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -93,6 +99,8 @@ describe('formatRecord', () => {
expected: {
id: 12,
record_type: 'MS',
+ sport_id: 1,
+ user: 'admin',
value: '18 km/h',
workout_date: '08/07/2019',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -116,6 +124,8 @@ describe('formatRecord', () => {
expected: {
id: 13,
record_type: 'HA',
+ sport_id: 1,
+ user: 'admin',
value: '100 m',
workout_date: 'Jul. 7th, 2019',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -156,6 +166,8 @@ describe('formatRecord after conversion', () => {
expected: {
id: 9,
record_type: 'AS',
+ sport_id: 1,
+ user: 'admin',
value: '11.18 mi/h',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -179,6 +191,8 @@ describe('formatRecord after conversion', () => {
expected: {
id: 10,
record_type: 'FD',
+ sport_id: 1,
+ user: 'admin',
value: '11.185 mi',
workout_date: '2019/08/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -202,6 +216,8 @@ describe('formatRecord after conversion', () => {
expected: {
id: 11,
record_type: 'LD',
+ sport_id: 1,
+ user: 'admin',
value: '1:01:00',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -225,6 +241,8 @@ describe('formatRecord after conversion', () => {
expected: {
id: 12,
record_type: 'MS',
+ sport_id: 1,
+ user: 'admin',
value: '11.18 mi/h',
workout_date: '2019/08/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -248,6 +266,8 @@ describe('formatRecord after conversion', () => {
expected: {
id: 13,
record_type: 'HA',
+ sport_id: 1,
+ user: 'admin',
value: '328.08 ft',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -327,6 +347,8 @@ describe('getRecordsBySports', () => {
{
id: 9,
record_type: 'AS',
+ sport_id: 1,
+ user: 'admin',
value: '18 km/h',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -378,6 +400,8 @@ describe('getRecordsBySports', () => {
{
id: 9,
record_type: 'AS',
+ sport_id: 1,
+ user: 'admin',
value: '18 km/h',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -385,6 +409,8 @@ describe('getRecordsBySports', () => {
{
id: 12,
record_type: 'MS',
+ sport_id: 1,
+ user: 'admin',
value: '18 km/h',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -398,6 +424,8 @@ describe('getRecordsBySports', () => {
{
id: 10,
record_type: 'FD',
+ sport_id: 2,
+ user: 'admin',
value: '18 km',
workout_date: '2019/08/07',
workout_id: 'n6JcLPQt3QtZWFfiSnYm4C',
@@ -459,6 +487,8 @@ describe('getRecordsBySports after conversion', () => {
{
id: 9,
record_type: 'AS',
+ sport_id: 1,
+ user: 'admin',
value: '11.18 mi/h',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -510,6 +540,8 @@ describe('getRecordsBySports after conversion', () => {
{
id: 9,
record_type: 'AS',
+ sport_id: 1,
+ user: 'admin',
value: '11.18 mi/h',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -517,6 +549,8 @@ describe('getRecordsBySports after conversion', () => {
{
id: 12,
record_type: 'MS',
+ sport_id: 1,
+ user: 'admin',
value: '11.18 mi/h',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',
@@ -530,6 +564,8 @@ describe('getRecordsBySports after conversion', () => {
{
id: 10,
record_type: 'FD',
+ sport_id: 2,
+ user: 'admin',
value: '11.185 mi',
workout_date: '2019/08/07',
workout_id: 'n6JcLPQt3QtZWFfiSnYm4C',
@@ -600,6 +636,8 @@ describe('getRecordsBySports with HA record', () => {
{
id: 9,
record_type: 'AS',
+ sport_id: 1,
+ user: 'admin',
value: '18 km/h',
workout_date: '2019/07/07',
workout_id: 'hvYBqYBRa7wwXpaStWR4V2',