mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 11:13:08 +02:00
35ec41fc1e
* enhance(backend): テストの高速化 * add ls * 自動的にマージされるようなので不要 * 起動方法を揃える * fix test
19 lines
795 B
TypeScript
19 lines
795 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { describe, expect, test } from '@jest/globals';
|
|
import { contentDisposition } from '@/misc/content-disposition.js';
|
|
|
|
describe('misc:content-disposition', () => {
|
|
test('inline', () => {
|
|
expect(contentDisposition('inline', 'foo bar')).toBe('inline; filename=\"foo_bar\"; filename*=UTF-8\'\'foo%20bar');
|
|
});
|
|
test('attachment', () => {
|
|
expect(contentDisposition('attachment', 'foo bar')).toBe('attachment; filename=\"foo_bar\"; filename*=UTF-8\'\'foo%20bar');
|
|
});
|
|
test('non ascii', () => {
|
|
expect(contentDisposition('attachment', 'ファイル名')).toBe('attachment; filename=\"_____\"; filename*=UTF-8\'\'%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%90%8D');
|
|
});
|
|
});
|