Client - display only active sports (+ workout sport) on workout edition
fix #129
This commit is contained in:
parent
f8df393d2d
commit
be0ac9b238
2
fittrackee/dist/index.html
vendored
2
fittrackee/dist/index.html
vendored
@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><link rel="stylesheet" href="/static/css/fork-awesome.min.css"><link rel="stylesheet" href="/static/css/leaflet.css"><title>FitTrackee</title><link href="/static/css/admin.e77f8b26.css" rel="prefetch"><link href="/static/css/profile.8b668068.css" rel="prefetch"><link href="/static/css/reset.fc19709e.css" rel="prefetch"><link href="/static/css/statistics.2afdc8a9.css" rel="prefetch"><link href="/static/css/workouts.5ffd5cc1.css" rel="prefetch"><link href="/static/js/admin.5f46d0fe.js" rel="prefetch"><link href="/static/js/chunk-2d0c9189.c81458cc.js" rel="prefetch"><link href="/static/js/chunk-2d0cf391.020c75ea.js" rel="prefetch"><link href="/static/js/chunk-2d0da8f3.c8c3e7e8.js" rel="prefetch"><link href="/static/js/chunk-2d2248b6.d84473c1.js" rel="prefetch"><link href="/static/js/chunk-2d22523a.4b710d99.js" rel="prefetch"><link href="/static/js/profile.d25975e2.js" rel="prefetch"><link href="/static/js/reset.ca898ebe.js" rel="prefetch"><link href="/static/js/statistics.d03ca304.js" rel="prefetch"><link href="/static/js/workouts.e3d575e0.js" rel="prefetch"><link href="/static/css/app.d45a3498.css" rel="preload" as="style"><link href="/static/js/app.82615f01.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.96f7cd19.js" rel="preload" as="script"><link href="/static/css/app.d45a3498.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="fittrackee_client"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but FitTrackee doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.96f7cd19.js"></script><script src="/static/js/app.82615f01.js"></script></body></html>
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><link rel="stylesheet" href="/static/css/fork-awesome.min.css"><link rel="stylesheet" href="/static/css/leaflet.css"><title>FitTrackee</title><link href="/static/css/admin.e77f8b26.css" rel="prefetch"><link href="/static/css/profile.8b668068.css" rel="prefetch"><link href="/static/css/reset.fc19709e.css" rel="prefetch"><link href="/static/css/statistics.2afdc8a9.css" rel="prefetch"><link href="/static/css/workouts.45a25b09.css" rel="prefetch"><link href="/static/js/admin.5f46d0fe.js" rel="prefetch"><link href="/static/js/chunk-2d0c9189.c81458cc.js" rel="prefetch"><link href="/static/js/chunk-2d0cf391.020c75ea.js" rel="prefetch"><link href="/static/js/chunk-2d0da8f3.c8c3e7e8.js" rel="prefetch"><link href="/static/js/chunk-2d2248b6.d84473c1.js" rel="prefetch"><link href="/static/js/chunk-2d22523a.4b710d99.js" rel="prefetch"><link href="/static/js/profile.d25975e2.js" rel="prefetch"><link href="/static/js/reset.ca898ebe.js" rel="prefetch"><link href="/static/js/statistics.d03ca304.js" rel="prefetch"><link href="/static/js/workouts.29d99435.js" rel="prefetch"><link href="/static/css/app.b54fa5fe.css" rel="preload" as="style"><link href="/static/js/app.20ff75b6.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.96f7cd19.js" rel="preload" as="script"><link href="/static/css/app.b54fa5fe.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="fittrackee_client"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but FitTrackee doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.96f7cd19.js"></script><script src="/static/js/app.20ff75b6.js"></script></body></html>
|
@ -64,7 +64,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
|
|||||||
"url": "/img/workouts/mountains.svg"
|
"url": "/img/workouts/mountains.svg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"revision": "b7b3db3d91da8b9f56e6884323729083",
|
"revision": "01fa6f51e99303e6aa0af8c057385a81",
|
||||||
"url": "/index.html"
|
"url": "/index.html"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -80,8 +80,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
|
|||||||
"url": "/static/css/admin.e77f8b26.css"
|
"url": "/static/css/admin.e77f8b26.css"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"revision": "1bd90ea525b6b37d9aaa",
|
"revision": "0a338b320a8168eedc37",
|
||||||
"url": "/static/css/app.d45a3498.css"
|
"url": "/static/css/app.b54fa5fe.css"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"revision": "82c1118c918377daaa71a320ab8eea42",
|
"revision": "82c1118c918377daaa71a320ab8eea42",
|
||||||
@ -104,8 +104,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
|
|||||||
"url": "/static/css/statistics.2afdc8a9.css"
|
"url": "/static/css/statistics.2afdc8a9.css"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"revision": "839b1979e05d0b296f23",
|
"revision": "c180861cd9daea671c18",
|
||||||
"url": "/static/css/workouts.5ffd5cc1.css"
|
"url": "/static/css/workouts.45a25b09.css"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"revision": "e719f9244c69e28e7d00e725ca1e280e",
|
"revision": "e719f9244c69e28e7d00e725ca1e280e",
|
||||||
@ -192,8 +192,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
|
|||||||
"url": "/static/js/admin.5f46d0fe.js"
|
"url": "/static/js/admin.5f46d0fe.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"revision": "1bd90ea525b6b37d9aaa",
|
"revision": "0a338b320a8168eedc37",
|
||||||
"url": "/static/js/app.82615f01.js"
|
"url": "/static/js/app.20ff75b6.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"revision": "bd7d183c9f68e5f4027d",
|
"revision": "bd7d183c9f68e5f4027d",
|
||||||
@ -232,7 +232,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
|
|||||||
"url": "/static/js/statistics.d03ca304.js"
|
"url": "/static/js/statistics.d03ca304.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"revision": "839b1979e05d0b296f23",
|
"revision": "c180861cd9daea671c18",
|
||||||
"url": "/static/js/workouts.e3d575e0.js"
|
"url": "/static/js/workouts.29d99435.js"
|
||||||
}
|
}
|
||||||
]);
|
]);
|
2
fittrackee/dist/service-worker.js
vendored
2
fittrackee/dist/service-worker.js
vendored
@ -14,7 +14,7 @@
|
|||||||
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
|
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
|
||||||
|
|
||||||
importScripts(
|
importScripts(
|
||||||
"/precache-manifest.72ed3f6c1b2aa3b8130086e25c17c6c0.js"
|
"/precache-manifest.0aa7df09e6fa099292b07eaf79ffeac5.js"
|
||||||
);
|
);
|
||||||
|
|
||||||
workbox.core.setCacheNameDetails({prefix: "fittrackee_client"});
|
workbox.core.setCacheNameDetails({prefix: "fittrackee_client"});
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
fittrackee/dist/static/js/app.20ff75b6.js
vendored
Normal file
2
fittrackee/dist/static/js/app.20ff75b6.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
fittrackee/dist/static/js/app.20ff75b6.js.map
vendored
Normal file
1
fittrackee/dist/static/js/app.20ff75b6.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
fittrackee/dist/static/js/app.82615f01.js
vendored
2
fittrackee/dist/static/js/app.82615f01.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
fittrackee/dist/static/js/workouts.29d99435.js.map
vendored
Normal file
1
fittrackee/dist/static/js/workouts.29d99435.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -189,7 +189,7 @@
|
|||||||
() => store.getters[SPORTS_STORE.GETTERS.SPORTS]
|
() => store.getters[SPORTS_STORE.GETTERS.SPORTS]
|
||||||
)
|
)
|
||||||
const translatedSports: ComputedRef<ITranslatedSport[]> = computed(() =>
|
const translatedSports: ComputedRef<ITranslatedSport[]> = computed(() =>
|
||||||
translateSports(sports.value, t, true, user.value.sports_list)
|
translateSports(sports.value, t, 'is_active', user.value.sports_list)
|
||||||
)
|
)
|
||||||
const loading = computed(
|
const loading = computed(
|
||||||
() => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]
|
() => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]
|
||||||
|
@ -267,8 +267,8 @@
|
|||||||
translateSports(
|
translateSports(
|
||||||
props.sports,
|
props.sports,
|
||||||
t,
|
t,
|
||||||
true,
|
'is_active_for_user',
|
||||||
workout.value.id ? [workout.value.sport_id] : null
|
workout.value.id ? [workout.value.sport_id] : []
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
const appConfig: ComputedRef<TAppConfig> = computed(
|
const appConfig: ComputedRef<TAppConfig> = computed(
|
||||||
|
@ -17,3 +17,5 @@ export interface ISportPayload {
|
|||||||
id: number
|
id: number
|
||||||
isActive: boolean
|
isActive: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type TActiveStatus = 'is_active' | 'is_active_for_user' | 'all'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ISport, ITranslatedSport } from '@/types/sports'
|
import { ISport, ITranslatedSport, TActiveStatus } from '@/types/sports'
|
||||||
import { IWorkout } from '@/types/workouts'
|
import { IWorkout } from '@/types/workouts'
|
||||||
|
|
||||||
// TODO: allow user to change colors
|
// TODO: allow user to change colors
|
||||||
@ -39,16 +39,14 @@ const sortSports = (a: ITranslatedSport, b: ITranslatedSport): number => {
|
|||||||
export const translateSports = (
|
export const translateSports = (
|
||||||
sports: ISport[],
|
sports: ISport[],
|
||||||
t: CallableFunction,
|
t: CallableFunction,
|
||||||
onlyActive = false,
|
activeStatus: TActiveStatus = 'all',
|
||||||
userSports: number[] | null = null
|
sportsToInclude: number[] = []
|
||||||
): ITranslatedSport[] =>
|
): ITranslatedSport[] =>
|
||||||
sports
|
sports
|
||||||
.filter((sport) =>
|
.filter((sport) =>
|
||||||
onlyActive
|
activeStatus === 'all'
|
||||||
? userSports === null
|
? true
|
||||||
? sport.is_active_for_user
|
: sportsToInclude.includes(sport.id) || sport[activeStatus]
|
||||||
: userSports.includes(sport.id) || sport.is_active
|
|
||||||
: true
|
|
||||||
)
|
)
|
||||||
.map((sport) => ({
|
.map((sport) => ({
|
||||||
...sport,
|
...sport,
|
||||||
|
@ -3,19 +3,33 @@ import { assert } from 'chai'
|
|||||||
import { sports } from './fixtures'
|
import { sports } from './fixtures'
|
||||||
|
|
||||||
import createI18n from '@/i18n'
|
import createI18n from '@/i18n'
|
||||||
|
import { ISport, TActiveStatus } from '@/types/sports'
|
||||||
import { translateSports } from '@/utils/sports'
|
import { translateSports } from '@/utils/sports'
|
||||||
|
|
||||||
const { t, locale } = createI18n.global
|
const { t, locale } = createI18n.global
|
||||||
|
|
||||||
|
interface IInputParam {
|
||||||
|
sports: ISport[]
|
||||||
|
locale: string
|
||||||
|
activeStatus: TActiveStatus
|
||||||
|
sportsToInclude: number[]
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ITestParameter {
|
||||||
|
description: string
|
||||||
|
inputParams: IInputParam
|
||||||
|
expected: Record<never, never>[]
|
||||||
|
}
|
||||||
|
|
||||||
describe('translateSports', () => {
|
describe('translateSports', () => {
|
||||||
const testsParams = [
|
const testsParams: ITestParameter[] = [
|
||||||
{
|
{
|
||||||
description: "returns sorted all translated sports (with 'en' locale)",
|
description: "returns sorted all translated sports (with 'en' locale)",
|
||||||
inputParams: {
|
inputParams: {
|
||||||
sports,
|
sports,
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
onlyActive: false,
|
activeStatus: 'all',
|
||||||
userSports: null,
|
sportsToInclude: [],
|
||||||
},
|
},
|
||||||
expected: [
|
expected: [
|
||||||
{
|
{
|
||||||
@ -55,12 +69,46 @@ describe('translateSports', () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
description:
|
description:
|
||||||
"returns sorted only translated sports, active for user (with 'en' locales)",
|
"returns sorted only active translated sports (with 'en' locales)",
|
||||||
inputParams: {
|
inputParams: {
|
||||||
sports,
|
sports,
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
onlyActive: true,
|
activeStatus: 'is_active',
|
||||||
userSports: null,
|
sportsToInclude: [],
|
||||||
|
},
|
||||||
|
expected: [
|
||||||
|
{
|
||||||
|
color: null,
|
||||||
|
has_workouts: false,
|
||||||
|
id: 1,
|
||||||
|
img: '/img/sports/cycling-sport.png',
|
||||||
|
is_active: true,
|
||||||
|
is_active_for_user: true,
|
||||||
|
label: 'Cycling (Sport)',
|
||||||
|
stopped_speed_threshold: 1,
|
||||||
|
translatedLabel: 'Cycling (Sport)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: null,
|
||||||
|
has_workouts: true,
|
||||||
|
id: 3,
|
||||||
|
img: '/img/sports/hiking.png',
|
||||||
|
is_active: true,
|
||||||
|
is_active_for_user: false,
|
||||||
|
label: 'Hiking',
|
||||||
|
stopped_speed_threshold: 0.1,
|
||||||
|
translatedLabel: 'Hiking',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description:
|
||||||
|
"returns sorted translated sports active for user (with 'en' locales)",
|
||||||
|
inputParams: {
|
||||||
|
sports,
|
||||||
|
locale: 'en',
|
||||||
|
activeStatus: 'is_active_for_user',
|
||||||
|
sportsToInclude: [],
|
||||||
},
|
},
|
||||||
expected: [
|
expected: [
|
||||||
{
|
{
|
||||||
@ -77,12 +125,12 @@ describe('translateSports', () => {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "returns empty array (with 'en' locale)",
|
description: "returns empty array if not sports (with 'en' locale)",
|
||||||
inputParams: {
|
inputParams: {
|
||||||
sports: [],
|
sports: [],
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
onlyActive: false,
|
activeStatus: 'all',
|
||||||
userSports: null,
|
sportsToInclude: [],
|
||||||
},
|
},
|
||||||
expected: [],
|
expected: [],
|
||||||
},
|
},
|
||||||
@ -91,8 +139,8 @@ describe('translateSports', () => {
|
|||||||
inputParams: {
|
inputParams: {
|
||||||
sports,
|
sports,
|
||||||
locale: 'fr',
|
locale: 'fr',
|
||||||
onlyActive: false,
|
activeStatus: 'all',
|
||||||
userSports: [],
|
sportsToInclude: [],
|
||||||
},
|
},
|
||||||
expected: [
|
expected: [
|
||||||
{
|
{
|
||||||
@ -132,12 +180,46 @@ describe('translateSports', () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
description:
|
description:
|
||||||
"returns sorted only translated sports, active for user (with 'fr' locales)",
|
"returns sorted only active translated sports (with 'fr' locales)",
|
||||||
inputParams: {
|
inputParams: {
|
||||||
sports,
|
sports,
|
||||||
locale: 'fr',
|
locale: 'fr',
|
||||||
onlyActive: true,
|
activeStatus: 'is_active',
|
||||||
userSports: null,
|
sportsToInclude: [],
|
||||||
|
},
|
||||||
|
expected: [
|
||||||
|
{
|
||||||
|
color: null,
|
||||||
|
has_workouts: true,
|
||||||
|
id: 3,
|
||||||
|
img: '/img/sports/hiking.png',
|
||||||
|
is_active: true,
|
||||||
|
is_active_for_user: false,
|
||||||
|
label: 'Hiking',
|
||||||
|
stopped_speed_threshold: 0.1,
|
||||||
|
translatedLabel: 'Randonnée',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: null,
|
||||||
|
has_workouts: false,
|
||||||
|
id: 1,
|
||||||
|
img: '/img/sports/cycling-sport.png',
|
||||||
|
is_active: true,
|
||||||
|
is_active_for_user: true,
|
||||||
|
label: 'Cycling (Sport)',
|
||||||
|
stopped_speed_threshold: 1,
|
||||||
|
translatedLabel: 'Vélo (Sport)',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description:
|
||||||
|
"returns sorted translated sports, active for user (with 'fr' locales)",
|
||||||
|
inputParams: {
|
||||||
|
sports,
|
||||||
|
locale: 'fr',
|
||||||
|
activeStatus: 'is_active_for_user',
|
||||||
|
sportsToInclude: [],
|
||||||
},
|
},
|
||||||
expected: [
|
expected: [
|
||||||
{
|
{
|
||||||
@ -154,12 +236,12 @@ describe('translateSports', () => {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "returns empty array (with 'fr' locale)",
|
description: "returns empty array if not sports (with 'fr' locale)",
|
||||||
inputParams: {
|
inputParams: {
|
||||||
sports: [],
|
sports: [],
|
||||||
locale: 'fr',
|
locale: 'fr',
|
||||||
onlyActive: false,
|
activeStatus: 'all',
|
||||||
userSports: null,
|
sportsToInclude: [],
|
||||||
},
|
},
|
||||||
expected: [],
|
expected: [],
|
||||||
},
|
},
|
||||||
@ -169,8 +251,8 @@ describe('translateSports', () => {
|
|||||||
inputParams: {
|
inputParams: {
|
||||||
sports,
|
sports,
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
onlyActive: false,
|
activeStatus: 'all',
|
||||||
userSports: [2],
|
sportsToInclude: [2],
|
||||||
},
|
},
|
||||||
expected: [
|
expected: [
|
||||||
{
|
{
|
||||||
@ -214,8 +296,8 @@ describe('translateSports', () => {
|
|||||||
inputParams: {
|
inputParams: {
|
||||||
sports,
|
sports,
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
onlyActive: true,
|
activeStatus: 'is_active',
|
||||||
userSports: [2],
|
sportsToInclude: [2],
|
||||||
},
|
},
|
||||||
expected: [
|
expected: [
|
||||||
{
|
{
|
||||||
@ -259,8 +341,8 @@ describe('translateSports', () => {
|
|||||||
inputParams: {
|
inputParams: {
|
||||||
sports: [],
|
sports: [],
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
onlyActive: false,
|
activeStatus: 'all',
|
||||||
userSports: null,
|
sportsToInclude: [2],
|
||||||
},
|
},
|
||||||
expected: [],
|
expected: [],
|
||||||
},
|
},
|
||||||
@ -270,8 +352,8 @@ describe('translateSports', () => {
|
|||||||
inputParams: {
|
inputParams: {
|
||||||
sports,
|
sports,
|
||||||
locale: 'fr',
|
locale: 'fr',
|
||||||
onlyActive: false,
|
activeStatus: 'all',
|
||||||
userSports: [2],
|
sportsToInclude: [2],
|
||||||
},
|
},
|
||||||
expected: [
|
expected: [
|
||||||
{
|
{
|
||||||
@ -315,8 +397,8 @@ describe('translateSports', () => {
|
|||||||
inputParams: {
|
inputParams: {
|
||||||
sports,
|
sports,
|
||||||
locale: 'fr',
|
locale: 'fr',
|
||||||
onlyActive: true,
|
activeStatus: 'is_active',
|
||||||
userSports: [2],
|
sportsToInclude: [2],
|
||||||
},
|
},
|
||||||
expected: [
|
expected: [
|
||||||
{
|
{
|
||||||
@ -360,8 +442,8 @@ describe('translateSports', () => {
|
|||||||
inputParams: {
|
inputParams: {
|
||||||
sports: [],
|
sports: [],
|
||||||
locale: 'fr',
|
locale: 'fr',
|
||||||
onlyActive: false,
|
activeStatus: 'all',
|
||||||
userSports: [2],
|
sportsToInclude: [2],
|
||||||
},
|
},
|
||||||
expected: [],
|
expected: [],
|
||||||
},
|
},
|
||||||
@ -373,8 +455,8 @@ describe('translateSports', () => {
|
|||||||
translateSports(
|
translateSports(
|
||||||
testParams.inputParams.sports,
|
testParams.inputParams.sports,
|
||||||
t,
|
t,
|
||||||
testParams.inputParams.onlyActive,
|
testParams.inputParams.activeStatus,
|
||||||
testParams.inputParams.userSports
|
testParams.inputParams.sportsToInclude
|
||||||
),
|
),
|
||||||
testParams.expected
|
testParams.expected
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user