|
1 | | -import { describe, expect, it } from 'vitest'; |
2 | 1 | import { Api } from 'telegram'; |
| 2 | +import { describe, expect, it } from 'vitest'; |
3 | 3 |
|
4 | 4 | import { getMediaLink, getMessageMediaUrl, withSearchParams } from './channel'; |
5 | 5 |
|
6 | 6 | describe('telegram tglib channel', () => { |
7 | 7 | it('preserves access auth params in telegram media urls', () => { |
8 | 8 | expect(getMessageMediaUrl('https://rsshub.app/telegram/channel/test?key=secret', 'test', 123)).toBe('https://rsshub.app/telegram/media/test/123?key=secret'); |
9 | 9 | expect(getMessageMediaUrl('https://rsshub.app/telegram/channel/test?code=signed', 'test', 123)).toBe('https://rsshub.app/telegram/media/test/123?code=signed'); |
10 | | - expect(getMessageMediaUrl('https://rsshub.app/telegram/channel/test?key=secret&code=signed', 'test', 123)).toBe( |
11 | | - 'https://rsshub.app/telegram/media/test/123?key=secret&code=signed' |
12 | | - ); |
| 10 | + expect(getMessageMediaUrl('https://rsshub.app/telegram/channel/test?key=secret&code=signed', 'test', 123)).toBe('https://rsshub.app/telegram/media/test/123?key=secret&code=signed'); |
13 | 11 | }); |
14 | 12 |
|
15 | 13 | it('appends thumb without dropping existing query params', () => { |
16 | | - expect(withSearchParams('https://rsshub.app/telegram/media/test/123?key=secret', { thumb: '' })).toBe( |
17 | | - 'https://rsshub.app/telegram/media/test/123?key=secret&thumb=' |
18 | | - ); |
| 14 | + expect(withSearchParams('https://rsshub.app/telegram/media/test/123?key=secret', { thumb: '' })).toBe('https://rsshub.app/telegram/media/test/123?key=secret&thumb='); |
19 | 15 | }); |
20 | 16 |
|
21 | 17 | it('renders video poster urls with preserved auth params', () => { |
|
0 commit comments