1
0
Fork 0

Fix check comments params unit tests

This commit is contained in:
Chocobozzz 2018-03-26 09:48:10 +02:00
parent ae09ed2c6a
commit 53eb90c0ab
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 3 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import { Validators } from '@angular/forms' import { Validators } from '@angular/forms'
export const VIDEO_COMMENT_TEXT = { export const VIDEO_COMMENT_TEXT = {
VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(3000) ], VALIDATORS: [ Validators.required, Validators.minLength(1), Validators.maxLength(3000) ],
MESSAGES: { MESSAGES: {
'required': 'Comment is required.', 'required': 'Comment is required.',
'minlength': 'Comment must be at least 2 characters long.', 'minlength': 'Comment must be at least 2 characters long.',

View file

@ -117,7 +117,7 @@ describe('Test video comments API validator', function () {
it('Should fail with a short comment', async function () { it('Should fail with a short comment', async function () {
const fields = { const fields = {
text: 'h'.repeat(3001) text: ''
} }
await makePostBodyRequest({ url: server.url, path: pathThread, token: server.accessToken, fields }) await makePostBodyRequest({ url: server.url, path: pathThread, token: server.accessToken, fields })
}) })
@ -160,7 +160,7 @@ describe('Test video comments API validator', function () {
it('Should fail with a short comment', async function () { it('Should fail with a short comment', async function () {
const fields = { const fields = {
text: 'h'.repeat(3001) text: ''
} }
await makePostBodyRequest({ url: server.url, path: pathComment, token: server.accessToken, fields }) await makePostBodyRequest({ url: server.url, path: pathComment, token: server.accessToken, fields })
}) })