mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-14 14:15:43 +01:00
refactor: forkでデフォルトのノート文字数を変更した場合、E2Eテストが落ちる問題を修正する (#11366)
* forkでデフォルトのノート文字数を変更した場合このテストが落ちる問題を修正する * 文字数についてのコメントを追加しておく
This commit is contained in:
parent
78b502bcab
commit
5083458071
1 changed files with 3 additions and 2 deletions
|
@ -5,6 +5,7 @@ import { Note } from '@/models/entities/Note.js';
|
||||||
import { signup, post, uploadUrl, startServer, initTestDb, api, uploadFile } from '../utils.js';
|
import { signup, post, uploadUrl, startServer, initTestDb, api, uploadFile } from '../utils.js';
|
||||||
import type { INestApplicationContext } from '@nestjs/common';
|
import type { INestApplicationContext } from '@nestjs/common';
|
||||||
import type * as misskey from 'misskey-js';
|
import type * as misskey from 'misskey-js';
|
||||||
|
import { MAX_NOTE_TEXT_LENGTH } from '@/const.js';
|
||||||
|
|
||||||
describe('Note', () => {
|
describe('Note', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
|
@ -164,7 +165,7 @@ describe('Note', () => {
|
||||||
|
|
||||||
test('文字数ぎりぎりで怒られない', async () => {
|
test('文字数ぎりぎりで怒られない', async () => {
|
||||||
const post = {
|
const post = {
|
||||||
text: '!'.repeat(3000),
|
text: '!'.repeat(MAX_NOTE_TEXT_LENGTH), // 3000文字
|
||||||
};
|
};
|
||||||
const res = await api('/notes/create', post, alice);
|
const res = await api('/notes/create', post, alice);
|
||||||
assert.strictEqual(res.status, 200);
|
assert.strictEqual(res.status, 200);
|
||||||
|
@ -172,7 +173,7 @@ describe('Note', () => {
|
||||||
|
|
||||||
test('文字数オーバーで怒られる', async () => {
|
test('文字数オーバーで怒られる', async () => {
|
||||||
const post = {
|
const post = {
|
||||||
text: '!'.repeat(3001),
|
text: '!'.repeat(MAX_NOTE_TEXT_LENGTH + 1), // 3001文字
|
||||||
};
|
};
|
||||||
const res = await api('/notes/create', post, alice);
|
const res = await api('/notes/create', post, alice);
|
||||||
assert.strictEqual(res.status, 400);
|
assert.strictEqual(res.status, 400);
|
||||||
|
|
Loading…
Reference in a new issue