@saooti/octopus-sdk 42.4.0-beta2 → 42.4.0-beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AccessibilityModal-CBIb3UQS.mjs → AccessibilityModal-CHUSDO1F.mjs} +39 -36
- package/dist/{AdvancedSearch-DVWO6WtG.mjs → AdvancedSearch-S-OMg1XH.mjs} +5 -5
- package/dist/{AuthStore-BBZTjLTf.mjs → AuthStore-BdiVUQBK.mjs} +268 -261
- package/dist/{CategoryChooser-fAUMJNHu.mjs → CategoryChooser-Cg_gq6L_.mjs} +1 -1
- package/dist/{CategoryFilter-CU4D9VlH.mjs → CategoryFilter-CI5PfekR.mjs} +3 -3
- package/dist/{CategoryList-CNRdGnw0.mjs → CategoryList-B0hCDa0Q.mjs} +2 -2
- package/dist/{CategoryPage-CJ_OohkC.mjs → CategoryPage-j1c3a9Ti.mjs} +2 -2
- package/dist/{CategorySearchFilter-Cce5zxZB.mjs → CategorySearchFilter-eRcZcX0o.mjs} +1 -1
- package/dist/{CheckIdentityModal-DEXrqR2G.mjs → CheckIdentityModal-DTA9VPdd.mjs} +3 -3
- package/dist/{ClassicAlert-DATLZ8J1.mjs → ClassicAlert-fZ4qLB-c.mjs} +1 -1
- package/dist/{ClassicBigChip-BK8v_P0z.mjs → ClassicBigChip-D0pRqFwb.mjs} +1 -1
- package/dist/ClassicColorPicker-DcjFDaZ8.mjs +79 -0
- package/dist/{ClassicDatePicker-CKIkZWmW.mjs → ClassicDatePicker-DlNlvjA0.mjs} +1 -1
- package/dist/{ClassicEmojiPicker-C0gm-DA2.mjs → ClassicEmojiPicker-Cc4UZRvZ.mjs} +1 -1
- package/dist/{ClassicHelpButton-BnRLmYuh.mjs → ClassicHelpButton-CDz_GcaZ.mjs} +1 -1
- package/dist/{ClassicInputText-YsntJkHk.mjs → ClassicInputText-4bPGD_kV.mjs} +1 -1
- package/dist/{ClassicLoading-CXfMjpyl.mjs → ClassicLoading-ydEDL7-R.mjs} +1 -1
- package/dist/{ClassicMultiselect-C0yzVQ8Y.mjs → ClassicMultiselect-CEJF_Uo5.mjs} +1 -1
- package/dist/{ClassicNotifications-Bt7HmFoU.mjs → ClassicNotifications-olXwz4qY.mjs} +2 -2
- package/dist/ClassicPopover-BpFChUHf.mjs +203 -0
- package/dist/ClassicSelect-Bj9BkTkd.mjs +121 -0
- package/dist/{ClassicSpinner-DFRDD51g.mjs → ClassicSpinner-P6q1es8G.mjs} +4 -1
- package/dist/{ClipboardModal-cHMlAcg3.mjs → ClipboardModal-D40ImhpB.mjs} +1 -1
- package/dist/{CommentInput-BiGn-skv.mjs → CommentInput-BGAQHUZh.mjs} +5 -5
- package/dist/CommentItem-CBtedADn.mjs +233 -0
- package/dist/CommentList-BqY6dXMt.mjs +203 -0
- package/dist/{CommentMoreActions-Cew7m8vJ.mjs → CommentMoreActions-BPDPuoeI.mjs} +6 -5
- package/dist/{CommentName-BQR1xl1T.mjs → CommentName-DiN2v6zm.mjs} +3 -3
- package/dist/{CommentParentInfo-BuM6sFV4.mjs → CommentParentInfo-DIyzK-2k.mjs} +3 -3
- package/dist/CommentSection-BUQsGQcN.mjs +119 -0
- package/dist/{CommentStore-BjzpqB_1.mjs → CommentStore-D-2Q49xZ.mjs} +76 -88
- package/dist/{ContractPreviewModal-CgEfHeyW.mjs → ContractPreviewModal-Duf8yY-7.mjs} +1 -1
- package/dist/{DateFilter-Bzx36_ol.mjs → DateFilter-Drn-Thgy.mjs} +1 -1
- package/dist/{DownloadPodcastButton-NStAbAZa.mjs → DownloadPodcastButton-BFZI5jmS.mjs} +2 -2
- package/dist/{EditCommentModal-coXmYdY_.mjs → EditCommentModal-CVihXEGS.mjs} +2 -2
- package/dist/{EmissionGroupChooser-XK05Hye9.mjs → EmissionGroupChooser-BaorNk90.mjs} +2 -2
- package/dist/{EmissionInlineList-CWP6yZLk.mjs → EmissionInlineList-DuzgE8hS.mjs} +36 -26
- package/dist/EmissionItem-R8ugPYq7.mjs +123 -0
- package/dist/EmissionList-Dk8Xtmm1.mjs +230 -0
- package/dist/EmissionPage-DE_T-aNF.mjs +191 -0
- package/dist/{EmissionPlayerItem-B-poSf0h.mjs → EmissionPlayerItem-w3F7l_dL.mjs} +9 -9
- package/dist/{EmissionPresentationItem-Ic_4QTAV.mjs → EmissionPresentationItem-VwylQjvv.mjs} +7 -4
- package/dist/{EmissionPresentationList-CZVjxQUN.mjs → EmissionPresentationList-Xu3G_Ozt.mjs} +8 -6
- package/dist/EmissionsPage--rvX0YYh.mjs +117 -0
- package/dist/{Error403Page-paQBIk_S.mjs → Error403Page-Cb0LAznd.mjs} +1 -1
- package/dist/ExternalLink-Xd1yTR71.mjs +35 -0
- package/dist/{FooterGarSection-GKI36V98.mjs → FooterGarSection-CnjLLyXU.mjs} +3 -3
- package/dist/{FooterSection-vNIJikKR.mjs → FooterSection-0e6Z_wff.mjs} +13 -13
- package/dist/{HomeDropdown-B_5YrOSF.mjs → HomeDropdown-5JO7NDSl.mjs} +3 -3
- package/dist/{HomePage-KC-CcJky.mjs → HomePage-Bze7mTbZ.mjs} +3 -3
- package/dist/InlineRubriqueList-MYnSX_eZ.mjs +48 -0
- package/dist/LikeButton-CnMZOm9N.mjs +46 -0
- package/dist/{LikeSection-BZcy0TOS.mjs → LikeSection-BFh6c0_F.mjs} +11 -17
- package/dist/ListPaginate-DMir5lKe.mjs +191 -0
- package/dist/{LiveHorizontalList-CARJlSBl.mjs → LiveHorizontalList-DpfoJMa8.mjs} +6 -6
- package/dist/{LiveList-DtXz2jZd.mjs → LiveList-BXcxoWAn.mjs} +12 -11
- package/dist/{LivesPage-DRyMTzoZ.mjs → LivesPage-X_Cuj5RC.mjs} +2 -2
- package/dist/{MapPage-CyDwoNuG.mjs → MapPage-DR7057o0.mjs} +1 -1
- package/dist/{MessageModal-BcqS77v6.mjs → MessageModal-DyD3HZy0.mjs} +1 -1
- package/dist/{MobileMenu-DWAO2ARf.mjs → MobileMenu-CaFQBVFA.mjs} +3 -3
- package/dist/{MonetizableFilter-B7NHzXEY.mjs → MonetizableFilter-BeBVeGSW.mjs} +1 -1
- package/dist/{NewsletterModal-GkC9RDyD.mjs → NewsletterModal-CaaLFdAc.mjs} +1 -1
- package/dist/{OctopusMultiselect-noQPQMZQ.mjs → OctopusMultiselect-B_VBxbac.mjs} +19 -19
- package/dist/OrganisationChooser-BSJWSByJ.mjs +134 -0
- package/dist/{OrganisationChooserLight-Afgr1M7a.mjs → OrganisationChooserLight-BpqeFaQP.mjs} +2 -2
- package/dist/{PageNotFound-B7hdl-yk.mjs → PageNotFound-BB2Der8l.mjs} +2 -2
- package/dist/PaginateParams-BKSnsVZH.mjs +54 -0
- package/dist/{ParticipantInlineList-BwPZSUqb.mjs → ParticipantInlineList-DBlnlk8x.mjs} +24 -19
- package/dist/ParticipantItem-1fs3gVfe.mjs +93 -0
- package/dist/ParticipantPage-BaWObZn8.mjs +127 -0
- package/dist/{ParticipantsPage-CHWCYVS6.mjs → ParticipantsPage-QsAeLeb5.mjs} +16 -16
- package/dist/{PlayerAnonymousModal-BdgjFawf.mjs → PlayerAnonymousModal-B9fZFffi.mjs} +2 -2
- package/dist/PlaylistPage-Blu1HnPY.mjs +130 -0
- package/dist/{PlaylistsPage-DTL-ovBn.mjs → PlaylistsPage-DLNnZSJT.mjs} +88 -77
- package/dist/{PodcastFilterList-2nVutkmB.mjs → PodcastFilterList-DrZA5iQa.mjs} +4 -3
- package/dist/PodcastInlineList-C-ICxCWh.mjs +186 -0
- package/dist/{PodcastInlineListTemplate-DPBRFNio.mjs → PodcastInlineListTemplate-CDigJ7BJ.mjs} +58 -56
- package/dist/PodcastItem-m3k-Kix9.mjs +305 -0
- package/dist/{PodcastList-R0TvKt6G.mjs → PodcastList-Cww-0Swl.mjs} +12 -12
- package/dist/{PodcastList-RMFwG0hb.mjs → PodcastList-s4gxQjq5.mjs} +26 -24
- package/dist/PodcastPage-DE5gGN-2.mjs +595 -0
- package/dist/PodcastPlayButton-Df0Z63M0.mjs +127 -0
- package/dist/PodcastPlaylistInlineList-D6FMozVy.mjs +69 -0
- package/dist/{PodcastPresentationList-BvXr6uwb.mjs → PodcastPresentationList-SouqGyw9.mjs} +9 -7
- package/dist/{PodcastmakerHeader-CKbQLcJR.mjs → PodcastmakerHeader-DJXLJTF6.mjs} +1 -1
- package/dist/PodcastsPage-BXBARaTK.mjs +133 -0
- package/dist/{ProductorSearch-DiKNztPx.mjs → ProductorSearch-hTTU45pI.mjs} +3 -3
- package/dist/QrCode-OEI1du8P.mjs +116 -0
- package/dist/{QrCodeModal-CWrtwMmo.mjs → QrCodeModal-DmzFi0FH.mjs} +1 -1
- package/dist/{RadioCurrently-Dp9E529F.mjs → RadioCurrently-CrRnrOIT.mjs} +20 -20
- package/dist/{RadioImage-C9DiBLS9.mjs → RadioImage-DmMQTUjw.mjs} +1 -1
- package/dist/RadioList-Bj_bfSqy.mjs +79 -0
- package/dist/{RadioPage-BxwU7iT4.mjs → RadioPage-BHAxW4eG.mjs} +5 -5
- package/dist/{RadioPlanning-iJ7XDZSH.mjs → RadioPlanning-Cg47XjD9.mjs} +3 -3
- package/dist/{RecaptchaModal-Bfq6A8y2.mjs → RecaptchaModal-DLMoPxPf.mjs} +2 -2
- package/dist/{ReportAbuseModal-DBoOqnzQ.mjs → ReportAbuseModal-CIiBTSpw.mjs} +4 -4
- package/dist/{RightsIndicator-DiA2ldB-.mjs → RightsIndicator-Dr75KTRE.mjs} +4 -4
- package/dist/{RightsWrapper-JmJz5r95.mjs → RightsWrapper-C6zNaunR.mjs} +41 -42
- package/dist/{RubriqueChoice-C-S-veJJ.mjs → RubriqueChoice-Ci23lZBD.mjs} +2 -2
- package/dist/{RubriqueChooser-CNGn8LcP.mjs → RubriqueChooser-C5QLRe-b.mjs} +1 -1
- package/dist/{RubriqueFilter-CD_iXdC1.mjs → RubriqueFilter-B_lwmZ8m.mjs} +3 -3
- package/dist/{RubriqueList-COReG7_w.mjs → RubriqueList-DNwhze-d.mjs} +4 -4
- package/dist/{RubriquePage-C63TsvkH.mjs → RubriquePage-Bh59Y29D.mjs} +6 -5
- package/dist/{SearchPage-ChdImq8B.mjs → SearchPage-DfsoWBQU.mjs} +2 -2
- package/dist/ShareAnonymous-QT4t2_n7.mjs +210 -0
- package/dist/{ShareModalPlayer-Dr0BUSDx.mjs → ShareModalPlayer-D0NzOzX0.mjs} +1 -1
- package/dist/{ShareNewsletter-DJbBxYn3.mjs → ShareNewsletter-DT893L87.mjs} +41 -44
- package/dist/{SharePlayer-AeYTgJw6.mjs → SharePlayer-Ctivrvmn.mjs} +2 -2
- package/dist/SharePlayerColors-CfrkwpdM.mjs +50 -0
- package/dist/{SharePlayerRadio-DxcP73-X.mjs → SharePlayerRadio-Gvc5Gc0f.mjs} +2 -2
- package/dist/{SharePlayerTypes-CuDLz2mJ.mjs → SharePlayerTypes-B3OKl3HO.mjs} +1 -1
- package/dist/ShareSocialsButtons-MbK7ivGa.mjs +103 -0
- package/dist/SmartLinkPage-BKihppLi.mjs +143 -0
- package/dist/SubscribeButtons-DKylNvPo.mjs +126 -0
- package/dist/SwiperList-CqElRAFt.mjs +179 -0
- package/dist/{TagList-DPkw1vux.mjs → TagList-CFgCrA_i.mjs} +5 -5
- package/dist/{TagPage-uVe7N9oG.mjs → TagPage-CWGLni8k.mjs} +3 -3
- package/dist/TopBar-CmZSpIiz.mjs +427 -0
- package/dist/UserButtonContent-CvVebdKv.mjs +129 -0
- package/dist/{buttons-BkfxHdGj.mjs → buttons-s19oovgO.mjs} +1 -1
- package/dist/{downloadHelper-CvnGPosg.mjs → downloadHelper-B7bFMASS.mjs} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +235 -232
- package/dist/{messages-DlxMAMOa.mjs → messages-DJAarMHp.mjs} +108 -6
- package/dist/src/components/display/comments/like/LikeButton.vue.d.ts +9 -33
- package/dist/src/components/display/comments/like/LikeSection.vue.d.ts +11 -33
- package/dist/src/components/display/emission/EmissionInlineList.vue.d.ts +4 -4
- package/dist/src/components/display/emission/EmissionItem.vue.d.ts +5 -1
- package/dist/src/components/display/emission/EmissionPresentationItem.vue.d.ts +2 -0
- package/dist/src/components/display/emission/EmissionPresentationList.vue.d.ts +1 -1
- package/dist/src/components/display/list/SwiperList.vue.d.ts +7 -4
- package/dist/src/components/display/live/RadioItem.vue.d.ts +11 -0
- package/dist/src/components/display/participant/ParticipantInlineList.vue.d.ts +1 -1
- package/dist/src/components/display/playlist/PlaylistItem.vue.d.ts +11 -0
- package/dist/src/components/display/podcasts/PodcastFilterList.vue.d.ts +3 -3
- package/dist/src/components/display/podcasts/PodcastImage.vue.d.ts +29 -9
- package/dist/src/components/display/podcasts/PodcastInlineList.vue.d.ts +45 -4
- package/dist/src/components/display/podcasts/PodcastInlineListTemplate.vue.d.ts +1 -1
- package/dist/src/components/display/podcasts/PodcastItem.vue.d.ts +7 -1
- package/dist/src/components/display/podcasts/PodcastItemInfo.vue.d.ts +10 -12
- package/dist/src/components/display/podcasts/PodcastList.vue.d.ts +2 -0
- package/dist/src/components/display/sharing/FormatSwitch.vue.d.ts +12 -17
- package/dist/src/components/form/ClassicColorPicker.vue.d.ts +26 -0
- package/dist/src/components/form/ClassicContentEditable.vue.d.ts +1 -1
- package/dist/src/components/form/ClassicInputText.vue.d.ts +1 -1
- package/dist/src/components/form/ClassicMultiselect.vue.d.ts +4 -4
- package/dist/src/components/form/index.d.ts +2 -1
- package/dist/src/components/layouts/PresentationItem.vue.d.ts +7 -3
- package/dist/src/components/misc/ClassicPopover.vue.d.ts +2 -0
- package/dist/src/components/misc/ExternalLink.vue.d.ts +27 -0
- package/dist/src/components/misc/LoadingOverlay.vue.d.ts +19 -0
- package/dist/src/components/misc/SkipToContent.vue.d.ts +7 -0
- package/dist/src/locale/messages.d.ts +102 -0
- package/dist/src/stores/AuthStore.d.ts +1 -0
- package/dist/src/stores/CommentStore.d.ts +3 -1
- package/dist/src/stores/ParamSdkStore.d.ts +30 -32
- package/dist/src/websocket/commentWebsocket.d.ts +3 -2
- package/dist/src/websocket/wss.d.ts +35 -32
- package/dist/tests-mocks.mjs +3 -2
- package/dist/tests.mjs +3 -2
- package/dist/{useAdvancedParamInit-Bn2nYh9V.mjs → useAdvancedParamInit-CdXta4Fd.mjs} +5 -5
- package/dist/{useAppleVideo-MNXcA2S0.mjs → useAppleVideo-C0gGIXRR.mjs} +1 -1
- package/dist/{useDayjs-DV3H3JdH.mjs → useDayjs-B6txyR3X.mjs} +1 -1
- package/dist/{useErrorHandler-BVeBrWmP.mjs → useErrorHandler-BPwwQKrG.mjs} +1 -1
- package/dist/{useImageProxy-aLDjafm4.mjs → useImageProxy-XMMC_IC2.mjs} +1 -1
- package/dist/{useOrgaComputed-q48Zu9Fs.mjs → useOrgaComputed-B0wJ-ALx.mjs} +1 -1
- package/dist/usePresentationItem-D6mrQ7Zp.mjs +104 -0
- package/dist/{useRights-tS_KEToi.mjs → useRights-B-RH3q3n.mjs} +1 -1
- package/dist/{useRubriquesFilterComputed-Xl5Dt2Xq.mjs → useRubriquesFilterComputed-Bp6L2o9-.mjs} +1 -1
- package/dist/{useRubriquesFilterParam-CIvIwIvX.mjs → useRubriquesFilterParam-B05QATg9.mjs} +1 -1
- package/dist/{useSharePlatforms-fUzHb1WM.mjs → useSharePlatforms-CbcKb6yZ.mjs} +26 -26
- package/dist/{useSimplePageParam-3Nn8EFc0.mjs → useSimplePageParam-DaoVpYoG.mjs} +1 -1
- package/eslint-config.mjs +10 -0
- package/package.json +4 -2
- package/src/api/rubriquesApi.ts +4 -4
- package/src/components/display/RightsIndicator.vue +0 -13
- package/src/components/display/RightsWrapper.vue +1 -16
- package/src/components/display/accessibility/AccessibilityModal.vue +7 -12
- package/src/components/display/comments/CommentInput.vue +2 -1
- package/src/components/display/comments/CommentList.vue +189 -176
- package/src/components/display/comments/CommentSection.vue +160 -73
- package/src/components/display/comments/item/CommentItem.vue +186 -135
- package/src/components/display/comments/item/CommentMoreActions.vue +195 -194
- package/src/components/display/comments/like/LikeButton.vue +47 -45
- package/src/components/display/comments/like/LikeSection.vue +122 -115
- package/src/components/display/emission/EmissionInlineList.vue +118 -116
- package/src/components/display/emission/EmissionItem.vue +35 -28
- package/src/components/display/emission/EmissionList.vue +41 -24
- package/src/components/display/emission/EmissionPresentationItem.vue +3 -0
- package/src/components/display/emission/EmissionPresentationList.vue +1 -0
- package/src/components/display/filter/ProductorSearch.vue +83 -80
- package/src/components/display/list/ListPaginate.vue +51 -37
- package/src/components/display/list/PaginateParams.vue +28 -32
- package/src/components/display/list/PaginateSection.vue +145 -138
- package/src/components/display/list/SwiperList.vue +113 -10
- package/src/components/display/live/LiveList.vue +111 -106
- package/src/components/display/live/RadioItem.vue +17 -12
- package/src/components/display/organisation/OrganisationChooser.vue +2 -1
- package/src/components/display/participant/ParticipantInlineList.vue +52 -49
- package/src/components/display/participant/ParticipantItem.vue +2 -1
- package/src/components/display/playlist/PlaylistItem.vue +19 -15
- package/src/components/display/playlist/PlaylistList.vue +16 -10
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +68 -61
- package/src/components/display/podcasts/AnimatorsItem.vue +2 -0
- package/src/components/display/podcasts/PodcastFilterList.vue +107 -106
- package/src/components/display/podcasts/PodcastImage.vue +110 -126
- package/src/components/display/podcasts/PodcastInlineList.vue +133 -25
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +2 -0
- package/src/components/display/podcasts/PodcastItem.vue +111 -64
- package/src/components/display/podcasts/PodcastItemInfo.vue +48 -18
- package/src/components/display/podcasts/PodcastList.vue +198 -194
- package/src/components/display/podcasts/PodcastModuleBox.vue +1 -0
- package/src/components/display/podcasts/PodcastPlayButton.vue +23 -6
- package/src/components/display/podcasts/PodcastPresentationList.vue +1 -0
- package/src/components/display/rubriques/InlineRubriqueList.vue +35 -16
- package/src/components/display/sharing/FormatSwitch.vue +90 -101
- package/src/components/display/sharing/QrCode.vue +4 -8
- package/src/components/display/sharing/ShareAnonymous.vue +207 -205
- package/src/components/display/sharing/ShareNewsletter.vue +3 -7
- package/src/components/display/sharing/SharePlayerColors.vue +5 -12
- package/src/components/display/sharing/ShareSocialsButtons.vue +67 -60
- package/src/components/display/sharing/SubscribeButtons.vue +47 -35
- package/src/components/form/ClassicColorPicker.vue +110 -0
- package/src/components/form/ClassicMultiselect.vue +205 -197
- package/src/components/form/ClassicSelect.vue +100 -80
- package/src/components/form/index.ts +2 -0
- package/src/components/layouts/PresentationItem.vue +18 -12
- package/src/components/misc/ClassicDataTable.vue +3 -3
- package/src/components/misc/ClassicPopover.vue +95 -1
- package/src/components/misc/ClassicSpinner.vue +16 -2
- package/src/components/misc/ExternalLink.vue +51 -0
- package/src/components/misc/LoadingOverlay.vue +86 -0
- package/src/components/misc/RightsScopeMenu.vue +1 -1
- package/src/components/misc/SkipToContent.vue +16 -0
- package/src/components/misc/TopBarMainContent.vue +6 -9
- package/src/components/misc/UserButtonContent.vue +4 -7
- package/src/components/pages/EmissionPage.vue +3 -2
- package/src/components/pages/EmissionsPage.vue +4 -0
- package/src/components/pages/ParticipantPage.vue +2 -1
- package/src/components/pages/PlaylistPage.vue +115 -110
- package/src/components/pages/PodcastPage.vue +3 -0
- package/src/components/pages/PodcastsPage.vue +4 -0
- package/src/components/pages/RubriquePage.vue +1 -0
- package/src/components/pages/SmartLinkPage.vue +10 -7
- package/src/layouts/FullLayout.vue +29 -23
- package/src/locale/de.json +18 -1
- package/src/locale/en.json +18 -1
- package/src/locale/es.json +18 -1
- package/src/locale/fr.json +22 -1
- package/src/locale/it.json +18 -1
- package/src/locale/sl.json +18 -1
- package/src/stores/AuthStore.ts +11 -1
- package/src/stores/CommentStore.ts +280 -263
- package/src/stores/ParamSdkStore.ts +39 -37
- package/src/style/_variables.scss +18 -0
- package/src/style/bootstrap.scss +40 -1
- package/src/style/general.scss +3 -3
- package/src/style/share.scss +26 -1
- package/src/websocket/commentWebsocket.ts +56 -54
- package/src/websocket/wss.ts +136 -163
- package/tests/components/display/comments/CommentList.spec.ts +45 -0
- package/tests/components/display/emission/EmissionItem.spec.ts +35 -0
- package/tests/components/display/emission/EmissionPresentationItem.spec.ts +6 -0
- package/tests/components/display/filter/ProductorSearch.spec.ts +20 -0
- package/tests/components/display/list/ListPaginate.spec.ts +67 -0
- package/tests/components/display/list/SwiperList.spec.ts +101 -2
- package/tests/components/display/live/RadioItem.spec.ts +41 -0
- package/tests/components/display/playlist/PlaylistItem.spec.ts +53 -0
- package/tests/components/display/podcasts/AnimatorsItem.spec.ts +18 -0
- package/tests/components/display/podcasts/PodcastInlineList.spec.ts +139 -0
- package/tests/components/display/podcasts/PodcastInlineListTemplate.spec.ts +16 -0
- package/tests/components/display/podcasts/PodcastItem.spec.ts +77 -0
- package/tests/components/display/podcasts/PodcastItemInfo.spec.ts +15 -2
- package/tests/components/display/podcasts/PodcastPlayButton.spec.ts +67 -0
- package/tests/components/display/sharing/FormatSwitch.spec.ts +26 -0
- package/tests/components/display/sharing/ShareAnonymous.spec.ts +61 -0
- package/tests/components/display/sharing/SubscribeButtons.spec.ts +73 -0
- package/tests/components/form/ClassicColorPicker.spec.ts +71 -0
- package/tests/components/form/ClassicSelect.spec.ts +38 -0
- package/tests/components/layouts/PresentationItem.spec.ts +34 -0
- package/tests/components/misc/ClassicPopover.spec.ts +112 -0
- package/tests/components/misc/ExternalLink.spec.ts +49 -0
- package/tests/components/misc/LoadingOverlay.spec.ts +27 -0
- package/tests/components/misc/SkipToContent.spec.ts +19 -0
- package/tests/components/pages/EmissionPage.spec.ts +9 -0
- package/tests/components/pages/EmissionsPage.spec.ts +13 -2
- package/tests/components/pages/PlaylistPage.spec.ts +11 -0
- package/tests/components/pages/PodcastsPage.spec.ts +13 -2
- package/tests/components/pages/SmartLinkPage.spec.ts +13 -0
- package/tests/helper/language.spec.ts +7 -3
- package/tests/mocks/useAdvancedParamInit.ts +2 -1
- package/tests/setup.ts +7 -0
- package/tests/stores/CommentStore.spec.ts +19 -0
- package/tests/utils.ts +5 -2
- package/tests/websocket/wss.spec.ts +153 -0
- package/dist/ClassicPopover-BUb-1WMB.mjs +0 -172
- package/dist/ClassicSelect-BpA0jKN6.mjs +0 -111
- package/dist/CommentItem-CY2-D9P3.mjs +0 -226
- package/dist/CommentList-CDIYZEq_.mjs +0 -201
- package/dist/CommentSection-BJZtgsut.mjs +0 -79
- package/dist/EmissionItem-BVsuGOnv.mjs +0 -116
- package/dist/EmissionList-E8czEUK3.mjs +0 -229
- package/dist/EmissionPage-CaDFKkE8.mjs +0 -192
- package/dist/EmissionsPage-C0jLjKTK.mjs +0 -116
- package/dist/InlineRubriqueList-BeGu04QD.mjs +0 -48
- package/dist/LikeButton-Cu8jAJHx.mjs +0 -40
- package/dist/ListPaginate-BYBfYtD5.mjs +0 -153
- package/dist/OrganisationChooser-CNNIw66c.mjs +0 -135
- package/dist/PaginateParams-Bjz3ZI-5.mjs +0 -75
- package/dist/ParticipantItem-CRnquj4R.mjs +0 -91
- package/dist/ParticipantPage-D0lJjj0p.mjs +0 -128
- package/dist/PlaylistPage-DMnkTMHk.mjs +0 -132
- package/dist/PodcastImage-DrIX2U4c.mjs +0 -115
- package/dist/PodcastInlineList-BtVDNokV.mjs +0 -123
- package/dist/PodcastItem-DYOmggEB.mjs +0 -151
- package/dist/PodcastPage-ClhwIq9v.mjs +0 -591
- package/dist/PodcastPlayButton-Bv61tl0L.mjs +0 -111
- package/dist/PodcastPlaylistInlineList-aZhxjz3p.mjs +0 -63
- package/dist/PodcastSwiperList-Cwh53maw.mjs +0 -170
- package/dist/PodcastsPage-CiEknka_.mjs +0 -132
- package/dist/QrCode-DITqqZq6.mjs +0 -109
- package/dist/RadioList-CTlVQuyN.mjs +0 -70
- package/dist/ShareAnonymous-kxt4P4zK.mjs +0 -199
- package/dist/SharePlayerColors-BpdifsHh.mjs +0 -49
- package/dist/ShareSocialsButtons-BhBqmgz7.mjs +0 -102
- package/dist/SmartLinkPage-Bupxsq-O.mjs +0 -136
- package/dist/SubscribeButtons-P1Jh_rFJ.mjs +0 -121
- package/dist/SwiperList-1mHT07oe.mjs +0 -117
- package/dist/TopBar-CeVHXg03.mjs +0 -427
- package/dist/UserButtonContent-CIq9izAe.mjs +0 -131
- package/dist/usePresentationItem-DWIj-6bU.mjs +0 -100
- package/src/components/display/podcasts/PodcastSwiperList.vue +0 -160
- package/src/helper/featureHelper.ts +0 -24
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { mockI18n } from '@tests/mocks';
|
|
2
|
+
vi.mock('vue-i18n', () => mockI18n());
|
|
3
|
+
|
|
4
|
+
import ClassicSelect from '@/components/form/ClassicSelect.vue';
|
|
5
|
+
import { mount } from '@tests/utils';
|
|
6
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
7
|
+
import { nextTick } from 'vue';
|
|
8
|
+
|
|
9
|
+
const options = [
|
|
10
|
+
{ title: 'Five', value: 5 },
|
|
11
|
+
{ title: 'Ten', value: 10 }
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
describe('ClassicSelect', () => {
|
|
15
|
+
it('selects the numeric option matching a numeric value', async () => {
|
|
16
|
+
const wrapper = await mount(ClassicSelect, { props: { options, textInit: 10 } });
|
|
17
|
+
expect(wrapper.find('select').element.value).toBe('10');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('selects the numeric option matching a string value', async () => {
|
|
21
|
+
const wrapper = await mount(ClassicSelect, { props: { options, textInit: '5' } });
|
|
22
|
+
expect(wrapper.find('select').element.value).toBe('5');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('selects the placeholder when the value is reset', async () => {
|
|
26
|
+
const wrapper = await mount(ClassicSelect, { props: { options, textInit: 10, placeholder: 'Choose' } });
|
|
27
|
+
await wrapper.setProps({ textInit: undefined });
|
|
28
|
+
expect(wrapper.find('select').element.value).toBe('');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('restores the displayed value when the parent does not accept the change', async () => {
|
|
32
|
+
const wrapper = await mount(ClassicSelect, { props: { options, textInit: 5 } });
|
|
33
|
+
await wrapper.find('select').setValue('10');
|
|
34
|
+
await nextTick();
|
|
35
|
+
expect(wrapper.emitted('update:textInit')).toEqual([['10']]);
|
|
36
|
+
expect(wrapper.find('select').element.value).toBe('5');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -34,4 +34,38 @@ describe('PresentationItem', () => {
|
|
|
34
34
|
expect(wrapper.find('.text-secondary').exists()).toBe(true);
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
+
|
|
38
|
+
describe('accessibility', () => {
|
|
39
|
+
it('renders the name in a h3 by default', async () => {
|
|
40
|
+
const wrapper = await mount({});
|
|
41
|
+
expect(wrapper.find('h3').text()).toBe('Item name');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('renders the name in the given heading', async () => {
|
|
45
|
+
const wrapper = await mount({ titleTag: 'h2' });
|
|
46
|
+
expect(wrapper.find('h2').text()).toBe('Item name');
|
|
47
|
+
expect(wrapper.find('h3').exists()).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('limits the link to the name', async () => {
|
|
51
|
+
const wrapper = await mount({ description: 'Some description' });
|
|
52
|
+
expect(wrapper.find('a').text()).toBe('Item name');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('does not nest the after-image slot in the link', async () => {
|
|
56
|
+
const wrapper = await testMount(PresentationItem, {
|
|
57
|
+
props: baseProps,
|
|
58
|
+
slots: { 'after-image': '<button>Play</button>' }
|
|
59
|
+
});
|
|
60
|
+
expect(wrapper.find('button').exists()).toBe(true);
|
|
61
|
+
expect(wrapper.find('a button').exists()).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('has a decorative image without title', async () => {
|
|
65
|
+
const wrapper = await mount({});
|
|
66
|
+
const img = wrapper.find('img');
|
|
67
|
+
expect(img.attributes('alt')).toBe('');
|
|
68
|
+
expect(img.attributes('title')).toBeUndefined();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
37
71
|
});
|
|
@@ -263,6 +263,82 @@ describe('ClassicPopover', () => {
|
|
|
263
263
|
});
|
|
264
264
|
});
|
|
265
265
|
|
|
266
|
+
describe('keyboard navigation (onlyClick=true)', () => {
|
|
267
|
+
const mountMenu = async () => {
|
|
268
|
+
wrapper = await testMount(ClassicPopover, {
|
|
269
|
+
props: { target: 'test-target', onlyClick: true },
|
|
270
|
+
slots: {
|
|
271
|
+
default: '<a href="/first" class="octopus-dropdown-item">First</a>'
|
|
272
|
+
+ '<button class="octopus-dropdown-item">Last</button>'
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
targetElement.focus();
|
|
276
|
+
};
|
|
277
|
+
const getItems = () => getPopoverEl().querySelectorAll<HTMLElement>('.octopus-dropdown-item');
|
|
278
|
+
const pressKey = async (element: Element, key: string, shiftKey = false) => {
|
|
279
|
+
element.dispatchEvent(new KeyboardEvent('keydown', { key, shiftKey, bubbles: true }));
|
|
280
|
+
element.dispatchEvent(new KeyboardEvent('keyup', { key, shiftKey, bubbles: true }));
|
|
281
|
+
await nextTick();
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
it('focuses the first item without navigating when opened by keyboard', async () => {
|
|
285
|
+
await mountMenu();
|
|
286
|
+
await openViaClick();
|
|
287
|
+
await nextTick();
|
|
288
|
+
|
|
289
|
+
expect(document.activeElement).toBe(getItems()[0]);
|
|
290
|
+
expect(routerPush).not.toHaveBeenCalled();
|
|
291
|
+
expect(isVisible()).toBe(true);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
it('does not move focus when opened by mouse', async () => {
|
|
295
|
+
await mountMenu();
|
|
296
|
+
targetElement.dispatchEvent(new MouseEvent('click', { detail: 1, bubbles: true }));
|
|
297
|
+
await nextTick();
|
|
298
|
+
await nextTick();
|
|
299
|
+
|
|
300
|
+
expect(document.activeElement).toBe(targetElement);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it.each([
|
|
304
|
+
['Shift+Tab on first item', 0, 'Tab', true],
|
|
305
|
+
['Tab on last item', 1, 'Tab', false],
|
|
306
|
+
['Escape', 0, 'Escape', false]
|
|
307
|
+
])('closes and focuses the target on %s', async (_, index, key, shiftKey) => {
|
|
308
|
+
await mountMenu();
|
|
309
|
+
await openViaClick();
|
|
310
|
+
await nextTick();
|
|
311
|
+
getItems()[index].focus();
|
|
312
|
+
|
|
313
|
+
await pressKey(getItems()[index], key, shiftKey);
|
|
314
|
+
|
|
315
|
+
expect(isVisible()).toBe(false);
|
|
316
|
+
expect(document.activeElement).toBe(targetElement);
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
it('closes and focuses the target when an item is activated by keyboard', async () => {
|
|
320
|
+
await mountMenu();
|
|
321
|
+
await openViaClick();
|
|
322
|
+
await nextTick();
|
|
323
|
+
|
|
324
|
+
getItems()[1].dispatchEvent(new MouseEvent('click', { detail: 0, bubbles: true }));
|
|
325
|
+
await nextTick();
|
|
326
|
+
await nextTick();
|
|
327
|
+
|
|
328
|
+
expect(isVisible()).toBe(false);
|
|
329
|
+
expect(document.activeElement).toBe(targetElement);
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
it('sets aria-controls and aria-expanded on the target', async () => {
|
|
333
|
+
await mountMenu();
|
|
334
|
+
expect(targetElement.getAttribute('aria-controls')).toBe('popovertest-target');
|
|
335
|
+
expect(targetElement.getAttribute('aria-expanded')).toBe('false');
|
|
336
|
+
|
|
337
|
+
await openViaClick();
|
|
338
|
+
expect(targetElement.getAttribute('aria-expanded')).toBe('true');
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
|
|
266
342
|
describe('expose clearClick method', () => {
|
|
267
343
|
it('exposes clearClick method to close popover programmatically', async () => {
|
|
268
344
|
await mount();
|
|
@@ -277,4 +353,40 @@ describe('ClassicPopover', () => {
|
|
|
277
353
|
expect(isVisible()).toBe(false);
|
|
278
354
|
});
|
|
279
355
|
});
|
|
356
|
+
|
|
357
|
+
describe('Popover API', () => {
|
|
358
|
+
const showPopover = vi.fn();
|
|
359
|
+
const hidePopover = vi.fn();
|
|
360
|
+
|
|
361
|
+
beforeEach(() => {
|
|
362
|
+
vi.clearAllMocks();
|
|
363
|
+
Object.assign(HTMLElement.prototype, { showPopover, hidePopover });
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
afterEach(() => {
|
|
367
|
+
const prototype = HTMLElement.prototype as unknown as Record<string, unknown>;
|
|
368
|
+
delete prototype.showPopover;
|
|
369
|
+
delete prototype.hidePopover;
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
it('is used to open and close a top layer popover', async () => {
|
|
373
|
+
await mount({ onlyClick: true, isTopLayer: true });
|
|
374
|
+
|
|
375
|
+
await openViaClick();
|
|
376
|
+
await nextTick();
|
|
377
|
+
expect(showPopover).toHaveBeenCalledOnce();
|
|
378
|
+
|
|
379
|
+
(wrapper!.vm as unknown as { clearClick: () => void }).clearClick();
|
|
380
|
+
await nextTick();
|
|
381
|
+
expect(hidePopover).toHaveBeenCalledOnce();
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
it('is not used otherwise', async () => {
|
|
385
|
+
await mount({ onlyClick: true });
|
|
386
|
+
|
|
387
|
+
await openViaClick();
|
|
388
|
+
await nextTick();
|
|
389
|
+
expect(showPopover).not.toHaveBeenCalled();
|
|
390
|
+
});
|
|
391
|
+
});
|
|
280
392
|
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { mockI18n } from '@tests/mocks';
|
|
2
|
+
vi.mock('vue-i18n', () => mockI18n());
|
|
3
|
+
|
|
4
|
+
import ExternalLink from '@/components/misc/ExternalLink.vue';
|
|
5
|
+
import { mount } from '@tests/utils';
|
|
6
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
7
|
+
|
|
8
|
+
const HREF = 'https://example.com';
|
|
9
|
+
|
|
10
|
+
describe('ExternalLink', () => {
|
|
11
|
+
const mountLink = (props: Record<string, unknown> = {}, slot = 'Example') =>
|
|
12
|
+
mount(ExternalLink, { props: { href: HREF, ...props }, slots: { default: slot } });
|
|
13
|
+
|
|
14
|
+
it('opens the url in a new window safely', async () => {
|
|
15
|
+
const link = (await mountLink()).find('a');
|
|
16
|
+
expect(link.attributes('href')).toBe(HREF);
|
|
17
|
+
expect(link.attributes('target')).toBe('_blank');
|
|
18
|
+
expect(link.attributes('rel')).toBe('noopener noreferrer');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('appends the new window warning to the visible text', async () => {
|
|
22
|
+
const wrapper = await mountLink();
|
|
23
|
+
expect(wrapper.find('.visually-hidden').text()).toBe('ExternalLink - New window');
|
|
24
|
+
expect(wrapper.text()).toBe('Example ExternalLink - New window');
|
|
25
|
+
expect(wrapper.find('a').attributes('aria-label')).toBeUndefined();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('renders a decorative icon by default', async () => {
|
|
29
|
+
const icon = (await mountLink()).find('.external-link-icon');
|
|
30
|
+
expect(icon.attributes('aria-hidden')).toBe('true');
|
|
31
|
+
expect(icon.attributes('role')).toBeUndefined();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('hides the icon on demand', async () => {
|
|
35
|
+
const wrapper = await mountLink({ hideIcon: true });
|
|
36
|
+
expect(wrapper.find('.external-link-icon').exists()).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('keeps the warning in the name of an image-only link', async () => {
|
|
40
|
+
const wrapper = await mountLink({}, '<img src="logo.png" alt="Logo">');
|
|
41
|
+
expect(wrapper.find('img').attributes('alt')).toBe('Logo');
|
|
42
|
+
expect(wrapper.find('.visually-hidden').text()).toBe('ExternalLink - New window');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('appends the warning to a given aria-label', async () => {
|
|
46
|
+
const wrapper = await mountLink({ ariaLabel: 'Example site' });
|
|
47
|
+
expect(wrapper.find('a').attributes('aria-label')).toBe('Example site ExternalLink - New window');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import LoadingOverlay from '@/components/misc/LoadingOverlay.vue';
|
|
2
|
+
import { mount } from '@tests/utils';
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { nextTick } from 'vue';
|
|
5
|
+
|
|
6
|
+
describe('LoadingOverlay', () => {
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] });
|
|
9
|
+
});
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
vi.useRealTimers();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('is only displayed after the delay', async () => {
|
|
15
|
+
const wrapper = await mount(LoadingOverlay, { props: { delay: 300 } });
|
|
16
|
+
expect(wrapper.find('.loading-overlay').exists()).toBe(false);
|
|
17
|
+
|
|
18
|
+
vi.advanceTimersByTime(300);
|
|
19
|
+
await nextTick();
|
|
20
|
+
expect(wrapper.find('.loading-overlay').exists()).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('is displayed immediately without delay', async () => {
|
|
24
|
+
const wrapper = await mount(LoadingOverlay, { props: { delay: 0 } });
|
|
25
|
+
expect(wrapper.find('.loading-overlay').exists()).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { mockI18n } from '@tests/mocks';
|
|
2
|
+
vi.mock('vue-i18n', () => mockI18n());
|
|
3
|
+
|
|
4
|
+
import SkipToContent from '@/components/misc/SkipToContent.vue';
|
|
5
|
+
import { mount } from '@tests/utils';
|
|
6
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
7
|
+
|
|
8
|
+
describe('SkipToContent', () => {
|
|
9
|
+
it('links to the main content by default', async () => {
|
|
10
|
+
const wrapper = await mount(SkipToContent);
|
|
11
|
+
expect(wrapper.find('a').attributes('href')).toBe('#main-content');
|
|
12
|
+
expect(wrapper.text()).toBe('Skip to content');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('links to the given target', async () => {
|
|
16
|
+
const wrapper = await mount(SkipToContent, { props: { target: 'content' } });
|
|
17
|
+
expect(wrapper.find('a').attributes('href')).toBe('#content');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -138,6 +138,15 @@ describe('EmissionPage', () => {
|
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
140
|
|
|
141
|
+
describe('accessibility', () => {
|
|
142
|
+
it('has a decorative image without title', async () => {
|
|
143
|
+
const wrapper = await mountPage();
|
|
144
|
+
const img = wrapper.find('img.img-box');
|
|
145
|
+
expect(img.attributes('alt')).toBe('');
|
|
146
|
+
expect(img.attributes('title')).toBeUndefined();
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
141
150
|
describe('podcastsFetched podcast selection', () => {
|
|
142
151
|
function makePodcast(seasonMode: SeasonMode, episodeNumber: number, { ready = true, visible = true } = {}) {
|
|
143
152
|
const podcast = makeReadyPodcast(seasonMode);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { mockAdvancedParamInit } from '@tests/mocks';
|
|
2
|
-
vi.mock('@/components/composable/route/useAdvancedParamInit', () => mockAdvancedParamInit(
|
|
2
|
+
vi.mock('@/components/composable/route/useAdvancedParamInit', () => mockAdvancedParamInit({
|
|
3
|
+
isInit: true,
|
|
4
|
+
organisationId: { value: undefined },
|
|
5
|
+
rubriquesFilterArrayIds: {}
|
|
6
|
+
}));
|
|
3
7
|
|
|
4
8
|
import EmissionsPage from '@/components/pages/EmissionsPage.vue';
|
|
5
9
|
import { mount } from '@tests/utils';
|
|
@@ -9,10 +13,17 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
9
13
|
describe('EmissionsPage', () => {
|
|
10
14
|
describe('props', () => {
|
|
11
15
|
it('initialize properly when not set', async() => {
|
|
12
|
-
const wrapper = await mount(EmissionsPage);
|
|
16
|
+
const wrapper = await mount(EmissionsPage, { shallow: true });
|
|
13
17
|
const props = wrapper.vm.$props as Record<string, number>;
|
|
14
18
|
expect(props.pr).toBeDefined();
|
|
15
19
|
expect(props.ps).toBeDefined();
|
|
16
20
|
});
|
|
17
21
|
});
|
|
22
|
+
|
|
23
|
+
it('has a visually hidden h1', async() => {
|
|
24
|
+
const wrapper = await mount(EmissionsPage, { shallow: true });
|
|
25
|
+
const h1 = wrapper.find('h1');
|
|
26
|
+
expect(h1.exists()).toBe(true);
|
|
27
|
+
expect(h1.classes()).toContain('visually-hidden');
|
|
28
|
+
});
|
|
18
29
|
});
|
|
@@ -57,4 +57,15 @@ describe('PlaylistPage', () => {
|
|
|
57
57
|
expect(wrapper.find('.edit-box-slot').exists()).toBe(false);
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
|
+
|
|
61
|
+
describe('accessibility', () => {
|
|
62
|
+
it('has a decorative image without title', async () => {
|
|
63
|
+
vi.mocked(playlistApi.get).mockResolvedValue(makePlaylist());
|
|
64
|
+
const wrapper = await mount(PlaylistPage, { shallow: true, props: { playlistId: 1 } });
|
|
65
|
+
|
|
66
|
+
const img = wrapper.find('img.img-box');
|
|
67
|
+
expect(img.attributes('alt')).toBe('');
|
|
68
|
+
expect(img.attributes('title')).toBeUndefined();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
60
71
|
});
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { mockAdvancedParamInit } from '@tests/mocks';
|
|
2
|
-
vi.mock('@/components/composable/route/useAdvancedParamInit', () => mockAdvancedParamInit(
|
|
2
|
+
vi.mock('@/components/composable/route/useAdvancedParamInit', () => mockAdvancedParamInit({
|
|
3
|
+
isInit: true,
|
|
4
|
+
organisationId: { value: undefined },
|
|
5
|
+
rubriquesFilterArrayIds: {}
|
|
6
|
+
}));
|
|
3
7
|
|
|
4
8
|
import PodcastsPage from '@/components/pages/PodcastsPage.vue';
|
|
5
9
|
import { mount } from '@tests/utils';
|
|
@@ -9,10 +13,17 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
9
13
|
describe('PodcastsPage', () => {
|
|
10
14
|
describe('props', () => {
|
|
11
15
|
it('initialize properly when not set', async() => {
|
|
12
|
-
const wrapper = await mount(PodcastsPage);
|
|
16
|
+
const wrapper = await mount(PodcastsPage, { shallow: true });
|
|
13
17
|
const props = wrapper.vm.$props as Record<string, number>;
|
|
14
18
|
expect(props.pr).toBeDefined();
|
|
15
19
|
expect(props.ps).toBeDefined();
|
|
16
20
|
});
|
|
17
21
|
});
|
|
22
|
+
|
|
23
|
+
it('has a visually hidden h1', async() => {
|
|
24
|
+
const wrapper = await mount(PodcastsPage, { shallow: true });
|
|
25
|
+
const h1 = wrapper.find('h1');
|
|
26
|
+
expect(h1.exists()).toBe(true);
|
|
27
|
+
expect(h1.classes()).toContain('visually-hidden');
|
|
28
|
+
});
|
|
18
29
|
});
|
|
@@ -86,4 +86,17 @@ describe('SmartLinkPage', () => {
|
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
|
+
|
|
90
|
+
it('opens footer links in a new window with a warning', async() => {
|
|
91
|
+
const wrapper = await mount(SmartLinkPage, {
|
|
92
|
+
props: { emissionId: 5 }
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const links = wrapper.findAll('.footer a');
|
|
96
|
+
expect(links.length).toBeGreaterThan(0);
|
|
97
|
+
links.forEach(link => {
|
|
98
|
+
expect(link.attributes('rel')).toBe('noopener noreferrer');
|
|
99
|
+
expect(link.find('.visually-hidden').exists()).toBe(true);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
89
102
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, it, expect,
|
|
1
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
2
|
import { getLanguage } from '../../src/helper/language';
|
|
3
3
|
|
|
4
4
|
function setNavigatorLanguage(lang: string) {
|
|
@@ -9,8 +9,12 @@ function setNavigatorLanguage(lang: string) {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
describe('language', () => {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// Reset before (not after) each test, as other test files may have
|
|
13
|
+
// left a language cookie behind when running without isolation
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
// happy-dom tracks cookies with and without an explicit path separately
|
|
16
|
+
document.cookie = 'octopus-language=; expires=Thu, 01 Jan 1970 00:00:00 GMT';
|
|
17
|
+
document.cookie = 'octopus-language=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
|
|
14
18
|
setNavigatorLanguage('fr-FR');
|
|
15
19
|
});
|
|
16
20
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function mockAdvancedParamInit() {
|
|
1
|
+
export function mockAdvancedParamInit(overrides: Record<string, unknown> = {}) {
|
|
2
2
|
return {
|
|
3
3
|
useAdvancedParamInit: () => ({
|
|
4
4
|
organisationId: undefined,
|
|
@@ -17,6 +17,7 @@ export function mockAdvancedParamInit() {
|
|
|
17
17
|
isInit: undefined,
|
|
18
18
|
beneficiaries: undefined,
|
|
19
19
|
emissionGroups: undefined,
|
|
20
|
+
...overrides
|
|
20
21
|
})
|
|
21
22
|
};
|
|
22
23
|
}
|
package/tests/setup.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { vi } from 'vitest';
|
|
2
|
+
|
|
3
|
+
// Tests run without isolation (see vitest.config.js), so the module registry
|
|
4
|
+
// is shared by all the test files of a worker. Reset it before each file so
|
|
5
|
+
// its vi.mock() calls apply even if an earlier file already imported the real
|
|
6
|
+
// modules (dependencies in node_modules are not affected and stay cached)
|
|
7
|
+
vi.resetModules();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCommentStore } from '@/stores/CommentStore';
|
|
2
|
+
import { setupPinia } from '@tests/utils';
|
|
3
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
describe('CommentStore', () => {
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
setupPinia();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('unsubscribeComments', () => {
|
|
11
|
+
it('resets the current podcast subscription', async () => {
|
|
12
|
+
const store = useCommentStore();
|
|
13
|
+
await store.initComments(1, 'orga');
|
|
14
|
+
await store.unsubscribeComments();
|
|
15
|
+
expect(store.commentPodcastId).toBeUndefined();
|
|
16
|
+
expect(store.commentQueueName).toBeUndefined();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
package/tests/utils.ts
CHANGED
|
@@ -34,7 +34,9 @@ export async function mount(component: Component, options?: {
|
|
|
34
34
|
/** Values to provide on the test app instance (e.g. to test values resolved at runtime via app.provide()/inject()) */
|
|
35
35
|
provide?: Record<string | symbol, unknown>,
|
|
36
36
|
/** Hook called before mounting with access to Pinia instance for store initialization */
|
|
37
|
-
beforeMount?: (pinia: Pinia) => void | Promise<void
|
|
37
|
+
beforeMount?: (pinia: Pinia) => void | Promise<void>,
|
|
38
|
+
/** Element to attach the component to, needed e.g. to test focus */
|
|
39
|
+
attachTo?: HTMLElement | string
|
|
38
40
|
}): Promise<VueWrapper> {
|
|
39
41
|
|
|
40
42
|
// Component stubbing
|
|
@@ -84,7 +86,8 @@ export async function mount(component: Component, options?: {
|
|
|
84
86
|
},
|
|
85
87
|
props: options?.props,
|
|
86
88
|
slots: options?.slots,
|
|
87
|
-
shallow: options?.shallow
|
|
89
|
+
shallow: options?.shallow,
|
|
90
|
+
attachTo: options?.attachTo
|
|
88
91
|
});
|
|
89
92
|
|
|
90
93
|
// Wait for dynamic imports
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import type { IMessage, StompConfig } from '@stomp/stompjs';
|
|
3
|
+
|
|
4
|
+
import WssConnection, { WssStatus } from '@/websocket/wss';
|
|
5
|
+
|
|
6
|
+
/** Minimal stand-in for the stompjs Client, driven manually by the tests */
|
|
7
|
+
class FakeClient {
|
|
8
|
+
static instance: FakeClient;
|
|
9
|
+
config: StompConfig;
|
|
10
|
+
connected = false;
|
|
11
|
+
active = false;
|
|
12
|
+
subscribe = vi.fn<(topic: string, callback: (message: IMessage) => void) => { unsubscribe: () => void }>(() => ({ unsubscribe: vi.fn() }));
|
|
13
|
+
|
|
14
|
+
constructor(config: StompConfig) {
|
|
15
|
+
this.config = config;
|
|
16
|
+
FakeClient.instance = this;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
activate(): void {
|
|
20
|
+
this.active = true;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async deactivate(): Promise<void> {
|
|
24
|
+
this.active = false;
|
|
25
|
+
this.connected = false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Simulate a successful connection (initial or reconnection) */
|
|
29
|
+
open(): void {
|
|
30
|
+
this.config.beforeConnect?.(this as never);
|
|
31
|
+
this.connected = true;
|
|
32
|
+
this.config.onConnect?.({} as never);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Simulate an unexpected loss of connection */
|
|
36
|
+
drop(): void {
|
|
37
|
+
this.connected = false;
|
|
38
|
+
this.config.onWebSocketClose?.({} as never);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Like stompjs, closing the socket triggers onWebSocketClose */
|
|
42
|
+
forceDisconnect = vi.fn(() => this.drop());
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
vi.mock('@stomp/stompjs', () => ({
|
|
46
|
+
default: undefined,
|
|
47
|
+
Client: FakeClient,
|
|
48
|
+
ReconnectionTimeMode: { EXPONENTIAL: 1 }
|
|
49
|
+
}));
|
|
50
|
+
vi.mock('sockjs-client/dist/sockjs', () => ({ default: vi.fn() }));
|
|
51
|
+
|
|
52
|
+
describe('wss', () => {
|
|
53
|
+
let onStatusChange: ReturnType<typeof vi.fn>;
|
|
54
|
+
let connection: WssConnection;
|
|
55
|
+
|
|
56
|
+
beforeEach(async () => {
|
|
57
|
+
onStatusChange = vi.fn();
|
|
58
|
+
connection = new WssConnection('example.com', 'websocket', onStatusChange);
|
|
59
|
+
await connection.connect();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const subscribedTopics = () => FakeClient.instance.subscribe.mock.calls.map(([topic]) => topic);
|
|
63
|
+
|
|
64
|
+
it('applies subscriptions made before connection once connected', () => {
|
|
65
|
+
connection.subscribe('/topic/a', vi.fn());
|
|
66
|
+
expect(subscribedTopics()).toEqual([]);
|
|
67
|
+
|
|
68
|
+
FakeClient.instance.open();
|
|
69
|
+
expect(subscribedTopics()).toEqual(['/topic/a']);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('restores each subscription exactly once after a reconnection', () => {
|
|
73
|
+
FakeClient.instance.open();
|
|
74
|
+
connection.subscribe('/topic/a', vi.fn());
|
|
75
|
+
connection.subscribe('/topic/b', vi.fn());
|
|
76
|
+
|
|
77
|
+
FakeClient.instance.drop();
|
|
78
|
+
FakeClient.instance.subscribe.mockClear();
|
|
79
|
+
FakeClient.instance.open();
|
|
80
|
+
|
|
81
|
+
expect(subscribedTopics()).toEqual(['/topic/a', '/topic/b']);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('does not restore unsubscribed topics', () => {
|
|
85
|
+
FakeClient.instance.open();
|
|
86
|
+
connection.subscribe('/topic/a', vi.fn());
|
|
87
|
+
connection.unsubscribe('/topic/a');
|
|
88
|
+
|
|
89
|
+
FakeClient.instance.drop();
|
|
90
|
+
FakeClient.instance.subscribe.mockClear();
|
|
91
|
+
FakeClient.instance.open();
|
|
92
|
+
|
|
93
|
+
expect(subscribedTopics()).toEqual([]);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('forwards received messages to the callback', async () => {
|
|
97
|
+
const callback = vi.fn();
|
|
98
|
+
FakeClient.instance.open();
|
|
99
|
+
connection.subscribe('/topic/a', callback);
|
|
100
|
+
|
|
101
|
+
const message = { body: '{}' } as IMessage;
|
|
102
|
+
FakeClient.instance.subscribe.mock.calls[0][1](message);
|
|
103
|
+
|
|
104
|
+
expect(callback).toHaveBeenCalledWith(message);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('reports status changes', async () => {
|
|
108
|
+
FakeClient.instance.open();
|
|
109
|
+
FakeClient.instance.drop();
|
|
110
|
+
FakeClient.instance.open();
|
|
111
|
+
await connection.disconnect();
|
|
112
|
+
|
|
113
|
+
expect(onStatusChange.mock.calls.map(([status]) => status)).toEqual([
|
|
114
|
+
WssStatus.CONNECTING,
|
|
115
|
+
WssStatus.CONNECTED,
|
|
116
|
+
WssStatus.DISCONNECTED,
|
|
117
|
+
WssStatus.CONNECTING,
|
|
118
|
+
WssStatus.CONNECTED,
|
|
119
|
+
WssStatus.INACTIVE
|
|
120
|
+
]);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('forces a reconnection and restores subscriptions when the broker sends an ERROR', () => {
|
|
124
|
+
const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
125
|
+
FakeClient.instance.open();
|
|
126
|
+
connection.subscribe('/topic/a', vi.fn());
|
|
127
|
+
FakeClient.instance.subscribe.mockClear();
|
|
128
|
+
|
|
129
|
+
FakeClient.instance.config.onStompError?.({ headers: { message: 'Connection to broker closed.' } } as never);
|
|
130
|
+
|
|
131
|
+
expect(FakeClient.instance.forceDisconnect).toHaveBeenCalledOnce();
|
|
132
|
+
expect(onStatusChange).toHaveBeenLastCalledWith(WssStatus.DISCONNECTED);
|
|
133
|
+
|
|
134
|
+
FakeClient.instance.open();
|
|
135
|
+
expect(subscribedTopics()).toEqual(['/topic/a']);
|
|
136
|
+
consoleError.mockRestore();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('discards the websocket on communication failure', () => {
|
|
140
|
+
expect(FakeClient.instance.config.discardWebsocketOnCommFailure).toBe(true);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('supports stompjs being exposed only as a default export', async () => {
|
|
144
|
+
vi.resetModules();
|
|
145
|
+
vi.doMock('@stomp/stompjs', () => ({
|
|
146
|
+
default: { Client: FakeClient, ReconnectionTimeMode: { EXPONENTIAL: 1 } }
|
|
147
|
+
}));
|
|
148
|
+
const { default: DefaultWssConnection } = await import('@/websocket/wss');
|
|
149
|
+
await new DefaultWssConnection('example.com', 'websocket').connect();
|
|
150
|
+
expect(FakeClient.instance.active).toBe(true);
|
|
151
|
+
vi.doUnmock('@stomp/stompjs');
|
|
152
|
+
});
|
|
153
|
+
});
|