@saooti/octopus-sdk 41.6.0 → 41.6.1
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -85,16 +85,17 @@ const router = useRouter();
|
|
|
85
85
|
const pathShare = computed(() => {
|
|
86
86
|
const orga = filterStore.filterOrgaId ? "?productor="+filterStore.filterOrgaId : "";
|
|
87
87
|
if(props.podcast) {
|
|
88
|
-
return router.resolve({ name: "podcast", params: { podcastId: props.podcast.podcastId } }) + orga;
|
|
88
|
+
return router.resolve({ name: "podcast", params: { podcastId: props.podcast.podcastId } }).path + orga;
|
|
89
89
|
}
|
|
90
90
|
if(props.emission){
|
|
91
|
-
return router.resolve({ name: "emission", params: { emissionId: props.emission.emissionId } }) + orga;
|
|
91
|
+
return router.resolve({ name: "emission", params: { emissionId: props.emission.emissionId } }).path + orga;
|
|
92
92
|
}
|
|
93
93
|
if(props.playlist){
|
|
94
|
-
return router.resolve({ name: "playlist", params: { playlistId: props.playlist.playlistId } }) + orga;
|
|
94
|
+
return router.resolve({ name: "playlist", params: { playlistId: props.playlist.playlistId } }).path + orga;
|
|
95
95
|
}
|
|
96
96
|
return "";
|
|
97
97
|
});
|
|
98
|
+
|
|
98
99
|
const newsletterInfo = computed(() => {
|
|
99
100
|
if (props.podcast) {
|
|
100
101
|
return {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import '@tests/mocks/useRouter';
|
|
2
|
+
import '@tests/mocks/i18n';
|
|
3
|
+
|
|
4
|
+
import ShareNewsletter from '@/components/display/sharing/ShareNewsletter.vue';
|
|
5
|
+
import { mount as testMount } from '@tests/utils';
|
|
6
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
7
|
+
import { useSaveFetchStore } from '@/stores/SaveFetchStore';
|
|
8
|
+
|
|
9
|
+
describe('ShareNewsletter', () => {
|
|
10
|
+
const mockSaveFetchStore = async () => {
|
|
11
|
+
const saveFetchStore = useSaveFetchStore();
|
|
12
|
+
vi.spyOn(saveFetchStore, 'getOrgaAttributes').mockResolvedValue({});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
it('newsletterHtml contains no "[object Object]" for a podcast', async () => {
|
|
16
|
+
const wrapper = await testMount(ShareNewsletter, {
|
|
17
|
+
props: {
|
|
18
|
+
podcast: {
|
|
19
|
+
podcastId: 1,
|
|
20
|
+
title: 'Episode title',
|
|
21
|
+
description: 'Episode description',
|
|
22
|
+
imageUrl: 'https://example.com/image.jpg',
|
|
23
|
+
article: 'https://example.com/article',
|
|
24
|
+
emission: { emissionId: 10, name: 'Emission name' },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
beforeMount: mockSaveFetchStore,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const html = (wrapper.vm as any).newsletterHtml;
|
|
31
|
+
expect(html).not.toContain('[object Object]');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('newsletterHtml contains no "[object Object]" for an emission', async () => {
|
|
35
|
+
const wrapper = await testMount(ShareNewsletter, {
|
|
36
|
+
props: {
|
|
37
|
+
emission: {
|
|
38
|
+
emissionId: 10,
|
|
39
|
+
name: 'Emission name',
|
|
40
|
+
description: 'Emission description',
|
|
41
|
+
imageUrl: 'https://example.com/image.jpg',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
beforeMount: mockSaveFetchStore,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const html = (wrapper.vm as any).newsletterHtml;
|
|
48
|
+
expect(html).not.toContain('[object Object]');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('newsletterHtml contains no "[object Object]" for a playlist', async () => {
|
|
52
|
+
const wrapper = await testMount(ShareNewsletter, {
|
|
53
|
+
props: {
|
|
54
|
+
playlist: {
|
|
55
|
+
playlistId: 20,
|
|
56
|
+
title: 'Playlist title',
|
|
57
|
+
description: 'Playlist description',
|
|
58
|
+
imageUrl: 'https://example.com/image.jpg',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
beforeMount: mockSaveFetchStore,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const html = (wrapper.vm as any).newsletterHtml;
|
|
65
|
+
expect(html).not.toContain('[object Object]');
|
|
66
|
+
});
|
|
67
|
+
});
|