-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
103 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,38 @@ | ||
import supertest from 'supertest'; | ||
import { HttpStatus } from '@nestjs/common'; | ||
|
||
export function itShouldReturnNotFound( | ||
export function itShouldReturn404( | ||
description: string, | ||
request: () => supertest.Test, | ||
args?: { description?: string }, | ||
) { | ||
it(args?.description ?? `should return 404`, async () => { | ||
it(`should return 404 ${description}`, async () => { | ||
await request().expect(HttpStatus.NOT_FOUND); | ||
}); | ||
} | ||
|
||
export function itShouldReturnUnauthorized(request: () => supertest.Test) { | ||
it('should return 401', async () => { | ||
export function itShouldReturn401( | ||
description: string, | ||
request: () => supertest.Test, | ||
) { | ||
it(`should return 401 ${description}`, async () => { | ||
await request().expect(HttpStatus.UNAUTHORIZED); | ||
}); | ||
} | ||
|
||
export function itShouldReturnOk(request: () => supertest.Test) { | ||
it('should return 200', async () => { | ||
export function itShouldReturn200( | ||
description: string, | ||
request: () => supertest.Test, | ||
) { | ||
it(`should return 200 ${description}`, async () => { | ||
await request().expect(HttpStatus.OK); | ||
}); | ||
} | ||
|
||
export function itShouldReturnCreated(request: () => supertest.Test) { | ||
it('should return 201', async () => { | ||
export function itShouldReturn201( | ||
description: string, | ||
request: () => supertest.Test, | ||
) { | ||
it(`should return 201 ${description}`, async () => { | ||
await request().expect(HttpStatus.CREATED); | ||
}); | ||
} |
20 changes: 20 additions & 0 deletions
20
apps/web/app/pages/dashboard/organization/receipts/components/CategoryCircle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
|
||
import { GetTransactionDto } from '~/api/Transaction/transactionApi.types'; | ||
import { Category } from '~/utils/Category'; | ||
|
||
interface CategoryCircleProps { | ||
data: GetTransactionDto['categories'][0]; | ||
} | ||
export function CategoryCircle({ data }: CategoryCircleProps) { | ||
const categoryItem = new Category(data); | ||
|
||
return ( | ||
<p | ||
className="w-6 h-6 rounded-full border border-input text-xs flex justify-center items-center bg-white" | ||
aria-label={categoryItem.name} | ||
> | ||
{categoryItem.icon} | ||
</p> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters