mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-07 09:03:27 -05:00
fix(api): trim trailing space if no reporter name (#52199)
This commit is contained in:
committed by
GitHub
parent
d4e65df8b0
commit
3940eddbbb
@@ -723,9 +723,11 @@ describe('userRoutes', () => {
|
||||
});
|
||||
|
||||
test('POST returns 200 status code with "success" message', async () => {
|
||||
const testUser = await fastifyTestInstance.prisma.user.findFirst({
|
||||
where: { email: testUserData.email }
|
||||
});
|
||||
const testUser = await fastifyTestInstance.prisma.user.findFirstOrThrow(
|
||||
{
|
||||
where: { email: testUserData.email }
|
||||
}
|
||||
);
|
||||
const response = await superRequest('/user/report-user', {
|
||||
method: 'POST',
|
||||
setCookies
|
||||
@@ -751,8 +753,8 @@ Luke, I am your father
|
||||
|
||||
|
||||
Reported by:
|
||||
Username: ${testUser?.username ?? ''}
|
||||
Name:
|
||||
Username: ${testUser.username}
|
||||
Name:
|
||||
Email: foo@bar.com
|
||||
|
||||
Thanks and regards,
|
||||
|
||||
@@ -24,7 +24,7 @@ ${reportDesc}
|
||||
|
||||
Reported by:
|
||||
Username: ${reporter.username}
|
||||
Name: ${reporter.name ?? ''}
|
||||
Name:${reporter.name ? ' ' + reporter.name : ''}
|
||||
Email: ${reporter.email}
|
||||
|
||||
Thanks and regards,
|
||||
|
||||
Reference in New Issue
Block a user