itube-specs 0.0.714 → 0.0.716
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/composables/{use-filter-scheme.test.ts → __tests__/use-filter-scheme.test.ts} +1 -1
- package/composables/{use-get-pure-route-name.test.ts → __tests__/use-get-pure-route-name.test.ts} +1 -1
- package/composables/{use-get-videos-filter-request.test.ts → __tests__/use-get-videos-filter-request.test.ts} +2 -2
- package/composables/{use-model-filter-chips.test.ts → __tests__/use-model-filter-chips.test.ts} +1 -1
- package/composables/{use-seo-links.test.ts → __tests__/use-seo-links.test.ts} +1 -1
- package/composables/{use-slug.test.ts → __tests__/use-slug.test.ts} +1 -1
- package/composables/{use-snackbar.test.ts → __tests__/use-snackbar.test.ts} +1 -1
- package/composables/{use-units.test.ts → __tests__/use-units.test.ts} +1 -1
- package/package.json +1 -1
- package/runtime/utils/{format-date.test.ts → __tests__/format-date.test.ts} +1 -1
- package/runtime/utils/{format-number.test.ts → __tests__/format-number.test.ts} +1 -1
- package/runtime/utils/{format-time-ago.test.ts → __tests__/format-time-ago.test.ts} +1 -1
- package/runtime/utils/{format-time.test.ts → __tests__/format-time.test.ts} +1 -1
- package/runtime/utils/{get-duration.test.ts → __tests__/get-duration.test.ts} +1 -1
- package/runtime/utils/{get-month.test.ts → __tests__/get-month.test.ts} +1 -1
- package/runtime/utils/{get-multiple-query.test.ts → __tests__/get-multiple-query.test.ts} +1 -1
- package/runtime/utils/{get-selected-query.test.ts → __tests__/get-selected-query.test.ts} +1 -1
- package/runtime/utils/{is-mobile-device.test.ts → __tests__/is-mobile-device.test.ts} +1 -1
- package/runtime/utils/{normalize-url.test.ts → __tests__/normalize-url.test.ts} +1 -1
- package/runtime/utils/{validate-email.test.ts → __tests__/validate-email.test.ts} +1 -1
- package/runtime/utils/{validate-password.test.ts → __tests__/validate-password.test.ts} +1 -1
- package/runtime/utils/{validate-phone.test.ts → __tests__/validate-phone.test.ts} +1 -1
- package/runtime/utils/{validate-username.test.ts → __tests__/validate-username.test.ts} +1 -1
- package/runtime/utils/{video-data-add-model-icon.test.ts → __tests__/video-data-add-model-icon.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-category-card.test.ts → __tests__/clean-category-card.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-category-info.test.ts → __tests__/clean-category-info.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-channel-card.test.ts → __tests__/clean-channel-card.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-channel-info.test.ts → __tests__/clean-channel-info.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-mini-category-card.test.ts → __tests__/clean-mini-category-card.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-model-card.test.ts → __tests__/clean-model-card.test.ts} +1 -1
- package/runtime/utils/cleaners/__tests__/clean-model-info.test.ts +45 -0
- package/runtime/utils/cleaners/{clean-playlist-card.test.ts → __tests__/clean-playlist-card.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-playlist-data.test.ts → __tests__/clean-playlist-data.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-playlist-video.test.ts → __tests__/clean-playlist-video.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-profile-data.test.ts → __tests__/clean-profile-data.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-user-playlists-card.test.ts → __tests__/clean-user-playlists-card.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-video-card.test.ts → __tests__/clean-video-card.test.ts} +1 -1
- package/runtime/utils/cleaners/{clean-video-data.test.ts → __tests__/clean-video-data.test.ts} +1 -1
- package/runtime/utils/converters/{convert-categories-to-chips.test.ts → __tests__/convert-categories-to-chips.test.ts} +1 -1
- package/runtime/utils/converters/{convert-categories-to-footer.test.ts → __tests__/convert-categories-to-footer.test.ts} +1 -1
- package/runtime/utils/converters/{convert-channel-to-round-card.test.ts → __tests__/convert-channel-to-round-card.test.ts} +1 -1
- package/runtime/utils/converters/{convert-date-to-timestamp.test.ts → __tests__/convert-date-to-timestamp.test.ts} +1 -1
- package/runtime/utils/converters/{convert-model-card-to-chips.test.ts → __tests__/convert-model-card-to-chips.test.ts} +1 -1
- package/runtime/utils/converters/{convert-model-to-round-card.test.ts → __tests__/convert-model-to-round-card.test.ts} +1 -1
- package/runtime/utils/converters/{convert-query-categories.test.ts → __tests__/convert-query-categories.test.ts} +1 -1
- package/runtime/utils/converters/{convert-snake-keys-to-camel.test.ts → __tests__/convert-snake-keys-to-camel.test.ts} +1 -1
- package/runtime/utils/converters/{convert-string-array-to-chips.test.ts → __tests__/convert-string-array-to-chips.test.ts} +1 -1
- package/runtime/utils/converters/{convert-string.test.ts → __tests__/convert-string.test.ts} +1 -1
- package/runtime/utils/converters/{group-categories-by-first-letter.test.ts → __tests__/group-categories-by-first-letter.test.ts} +1 -1
- package/runtime/utils/converters/{group-objects-by-first-letter.test.ts → __tests__/group-objects-by-first-letter.test.ts} +1 -1
- package/runtime/utils/server/{parse-api-error.test.ts → __tests__/parse-api-error.test.ts} +1 -1
package/composables/{use-get-pure-route-name.test.ts → __tests__/use-get-pure-route-name.test.ts}
RENAMED
|
@@ -5,7 +5,7 @@ vi.mock('vue-router', () => ({
|
|
|
5
5
|
}));
|
|
6
6
|
|
|
7
7
|
import { useRoute } from 'vue-router';
|
|
8
|
-
import { useGetPureRouteName } from '
|
|
8
|
+
import { useGetPureRouteName } from '../use-get-pure-route-name';
|
|
9
9
|
|
|
10
10
|
describe('useGetPureRouteName', () => {
|
|
11
11
|
it('убирает суффикс ___en', () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { vi, describe, it, expect } from 'vitest';
|
|
2
2
|
|
|
3
|
-
vi.mock('
|
|
3
|
+
vi.mock('../../runtime', () => ({
|
|
4
4
|
getMultipleQuery: () => ({}),
|
|
5
5
|
}));
|
|
6
6
|
|
|
7
|
-
import { useGetVideosFilterRequest } from '
|
|
7
|
+
import { useGetVideosFilterRequest } from '../use-get-videos-filter-request';
|
|
8
8
|
|
|
9
9
|
describe('useGetVideosFilterRequest', () => {
|
|
10
10
|
it('всегда возвращает categories_filter_use_and', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @vitest-environment nuxt
|
|
2
2
|
import { describe, it, expect, beforeEach } from 'vitest';
|
|
3
3
|
import { mockNuxtImport } from '@nuxt/test-utils/runtime';
|
|
4
|
-
import { useSeoLinks } from '
|
|
4
|
+
import { useSeoLinks } from '../use-seo-links';
|
|
5
5
|
|
|
6
6
|
let mockRoute = { path: '/videos', query: {} as Record<string, any> };
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { videoDataAddModelIcon } from '
|
|
2
|
+
import { videoDataAddModelIcon } from '../video-data-add-model-icon';
|
|
3
3
|
|
|
4
4
|
describe('videoDataAddModelIcon', () => {
|
|
5
5
|
it('добавляет icon к matching модели', () => {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { cleanModelInfo } from '../clean-model-info';
|
|
3
|
+
|
|
4
|
+
describe('cleanModelInfo', () => {
|
|
5
|
+
it('полные данные', () => {
|
|
6
|
+
const raw = {
|
|
7
|
+
title: 'Model Name',
|
|
8
|
+
description: 'desc',
|
|
9
|
+
social: '@model',
|
|
10
|
+
videos_count: 50,
|
|
11
|
+
video_thumb_urls: { webp: { '320x180': 'https://img.com/s.webp' } },
|
|
12
|
+
parameters: 'height: 170',
|
|
13
|
+
long_description: 'long desc',
|
|
14
|
+
bio: 'bio text',
|
|
15
|
+
relatedNames: ['Model B'],
|
|
16
|
+
};
|
|
17
|
+
const result = cleanModelInfo(raw as any);
|
|
18
|
+
expect(result.title).toBe('Model Name');
|
|
19
|
+
expect(result.description).toBe('desc');
|
|
20
|
+
expect(result.social).toBe('@model');
|
|
21
|
+
expect(result.videosCount).toBe(50);
|
|
22
|
+
expect(result.img).toBe('https://img.com/s.webp');
|
|
23
|
+
expect(result.parameters).toBe('height: 170');
|
|
24
|
+
expect(result.fullDescription).toBe('long desc');
|
|
25
|
+
expect(result.relatedNames).toEqual(['Model B']);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('без long_description → берёт bio', () => {
|
|
29
|
+
const raw = { long_description: '', bio: 'bio text', video_thumb_urls: { webp: {} } };
|
|
30
|
+
const result = cleanModelInfo(raw as any);
|
|
31
|
+
expect(result.fullDescription).toBe('bio text');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('пустые данные → дефолты', () => {
|
|
35
|
+
const result = cleanModelInfo({} as any);
|
|
36
|
+
expect(result.title).toBe('');
|
|
37
|
+
expect(result.description).toBe('');
|
|
38
|
+
expect(result.social).toBe('');
|
|
39
|
+
expect(result.videosCount).toBe(0);
|
|
40
|
+
expect(result.img).toBe('');
|
|
41
|
+
expect(result.parameters).toBe('');
|
|
42
|
+
expect(result.fullDescription).toBe('');
|
|
43
|
+
expect(result.relatedNames).toEqual([]);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { convertCategoriesToChips } from '
|
|
2
|
+
import { convertCategoriesToChips } from '../convert-categories-to-chips';
|
|
3
3
|
|
|
4
4
|
describe('convertCategoriesToChips', () => {
|
|
5
5
|
it('конвертирует массив категорий в чипсы', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { convertCategoriesToFooter } from '
|
|
2
|
+
import { convertCategoriesToFooter } from '../convert-categories-to-footer';
|
|
3
3
|
|
|
4
4
|
describe('convertCategoriesToFooter', () => {
|
|
5
5
|
it('конвертирует категории в футер', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { convertChannelToRoundCard } from '
|
|
2
|
+
import { convertChannelToRoundCard } from '../convert-channel-to-round-card';
|
|
3
3
|
|
|
4
4
|
describe('convertChannelToRoundCard', () => {
|
|
5
5
|
it('конвертирует канал в round card', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { convertModelCardToChips } from '
|
|
2
|
+
import { convertModelCardToChips } from '../convert-model-card-to-chips';
|
|
3
3
|
|
|
4
4
|
describe('convertModelCardToChips', () => {
|
|
5
5
|
it('конвертирует карточки моделей в чипсы', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { convertModelToRoundCard } from '
|
|
2
|
+
import { convertModelToRoundCard } from '../convert-model-to-round-card';
|
|
3
3
|
|
|
4
4
|
describe('convertModelToRoundCard', () => {
|
|
5
5
|
it('конвертирует модель в round card', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { convertQueryCategories } from '
|
|
2
|
+
import { convertQueryCategories } from '../convert-query-categories';
|
|
3
3
|
|
|
4
4
|
describe('convertQueryCategories', () => {
|
|
5
5
|
it('конвертирует query категории', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { convertSnakeKeysToCamel } from '
|
|
2
|
+
import { convertSnakeKeysToCamel } from '../convert-snake-keys-to-camel';
|
|
3
3
|
|
|
4
4
|
describe('convertSnakeKeysToCamel', () => {
|
|
5
5
|
it('простой объект', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { convertStringArrayToChips } from '
|
|
2
|
+
import { convertStringArrayToChips } from '../convert-string-array-to-chips';
|
|
3
3
|
|
|
4
4
|
describe('convertStringArrayToChips', () => {
|
|
5
5
|
it('конвертирует массив строк в чипсы', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { groupCategoriesByFirstLetter } from '
|
|
2
|
+
import { groupCategoriesByFirstLetter } from '../group-categories-by-first-letter';
|
|
3
3
|
|
|
4
4
|
const items = [
|
|
5
5
|
{ title: 'Amateur', name: 'amateur', videosCount: 10, guid: '1', icon: '', is_top: false },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { groupObjectsByFirstLetter } from '
|
|
2
|
+
import { groupObjectsByFirstLetter } from '../group-objects-by-first-letter';
|
|
3
3
|
|
|
4
4
|
describe('groupObjectsByFirstLetter', () => {
|
|
5
5
|
const items = [
|