Skip to content

Commit d7820bb

Browse files
committed
limit github user mocks username length
1 parent 37d4638 commit d7820bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/mocks/github.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { fileURLToPath } from 'node:url'
33
import { faker } from '@faker-js/faker'
44
import fsExtra from 'fs-extra'
55
import { HttpResponse, passthrough, http, type HttpHandler } from 'msw'
6+
import { USERNAME_MAX_LENGTH } from '#app/utils/user-validation.ts'
67

78
const { json } = HttpResponse
89

@@ -54,7 +55,7 @@ function createGitHubUser(code?: string | null) {
5455
code,
5556
accessToken: `${code}_mock_access_token`,
5657
profile: {
57-
login: faker.internet.username(),
58+
login: faker.internet.username().slice(0, USERNAME_MAX_LENGTH),
5859
id: faker.number.int(),
5960
name: faker.person.fullName(),
6061
avatar_url: 'https://github.com/ghost.png',

0 commit comments

Comments
 (0)