Skip to content

Commit caa2843

Browse files
committed
fix tests and lint errors
1 parent ac618c3 commit caa2843

File tree

20 files changed

+55
-34
lines changed

20 files changed

+55
-34
lines changed

packages/apps/fortune/exchange-oracle/server/src/common/interceptors/transform-enum.interceptor.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ export class TransformEnumInterceptor implements NestInterceptor {
5555
: null;
5656
}
5757

58-
private transformEnums(bodyOrQuery: any, targetClass: ClassConstructor<any>): any {
58+
private transformEnums(
59+
bodyOrQuery: any,
60+
targetClass: ClassConstructor<any>,
61+
): any {
5962
// Convert the body or query to an instance of the target class
6063
let transformedInstance = plainToInstance(targetClass, bodyOrQuery);
6164

@@ -111,4 +114,4 @@ export class TransformEnumInterceptor implements NestInterceptor {
111114
}
112115
return bodyOrQuery;
113116
}
114-
}
117+
}

packages/apps/fortune/exchange-oracle/server/src/common/pagination/pagination.dto.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2-
import {
3-
IsNumber,
4-
IsOptional,
5-
Max,
6-
Min,
7-
IsArray,
8-
} from 'class-validator';
2+
import { IsNumber, IsOptional, Max, Min, IsArray } from 'class-validator';
93
import { Type } from 'class-transformer';
104
import { SortDirection } from '../enums/collection';
115
import { IsEnumCaseInsensitive } from '../decorators/enums';

packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.controller.spec.ts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,10 @@ describe('assignmentController', () => {
5757
.spyOn(assignmentService, 'getAssignmentList')
5858
.mockResolvedValue(expectedResult);
5959

60-
const result = await assignmentController.getAssignments(
61-
query,
62-
{
63-
user: { address: userAddress, reputationNetwork: reputationNetwork },
64-
headers: { referer: MOCK_EXCHANGE_ORACLE },
65-
} as any,
66-
);
60+
const result = await assignmentController.getAssignments(query, {
61+
user: { address: userAddress, reputationNetwork: reputationNetwork },
62+
headers: { referer: MOCK_EXCHANGE_ORACLE },
63+
} as any);
6764
expect(result).toBe(expectedResult);
6865
expect(assignmentService.getAssignmentList).toHaveBeenCalledWith(
6966
query,
@@ -82,12 +79,9 @@ describe('assignmentController', () => {
8279
jest
8380
.spyOn(assignmentService, 'createAssignment')
8481
.mockResolvedValue({ id: 1 } as any);
85-
await assignmentController.createAssignment(
86-
body,
87-
{
88-
user: { address: userAddress },
89-
} as RequestWithUser,
90-
);
82+
await assignmentController.createAssignment(body, {
83+
user: { address: userAddress },
84+
} as RequestWithUser);
9185
expect(assignmentService.createAssignment).toHaveBeenCalledWith(body, {
9286
address: userAddress,
9387
});
@@ -103,10 +97,9 @@ describe('assignmentController', () => {
10397

10498
jest.spyOn(assignmentService, 'resign').mockResolvedValue();
10599

106-
await assignmentController.resign(
107-
resignJobDto,
108-
{ user: { address: userAddress } } as RequestWithUser,
109-
);
100+
await assignmentController.resign(resignJobDto, {
101+
user: { address: userAddress },
102+
} as RequestWithUser);
110103

111104
expect(assignmentService.resign).toHaveBeenCalledWith(
112105
assignmentId,

packages/apps/human-app/frontend/src/auth-web3/require-wallet-connect.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { WalletConnectContextConnectedAccount } from '@/contexts/wallet-con
55
import { routerPaths } from '@/router/router-paths';
66
import { PageCardLoader } from '@/components/ui/page-card';
77

8+
// eslint-disable-next-line react-refresh/only-export-components
89
export const AuthWeb3Context =
910
createContext<WalletConnectContextConnectedAccount | null>(null);
1011

packages/apps/human-app/frontend/src/auth-web3/require-web3-auth.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { Web3AuthenticatedUserContextType } from '@/auth-web3/web3-auth-con
55
import { PageCardLoader } from '@/components/ui/page-card';
66
import { useWeb3Auth } from '@/auth-web3/use-web3-auth';
77

8+
// eslint-disable-next-line react-refresh/only-export-components
89
export const Web3AuthenticatedUserContext =
910
createContext<Web3AuthenticatedUserContextType | null>(null);
1011

packages/apps/human-app/frontend/src/auth-web3/web3-auth-context.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ interface Web3UnauthenticatedUserContextType {
3333
signIn: (singIsSuccess: SignInSuccessResponse) => void;
3434
}
3535

36+
// eslint-disable-next-line react-refresh/only-export-components
3637
export const Web3AuthContext = createContext<
3738
Web3AuthenticatedUserContextType | Web3UnauthenticatedUserContextType | null
3839
>(null);

packages/apps/human-app/frontend/src/auth/auth-context.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ interface UnauthenticatedUserContextType {
4343
signIn: (singIsSuccess: SignInSuccessResponse) => void;
4444
}
4545

46+
// eslint-disable-next-line react-refresh/only-export-components
4647
export const AuthContext = createContext<
4748
AuthenticatedUserContextType | UnauthenticatedUserContextType | null
4849
>(null);

packages/apps/human-app/frontend/src/auth/require-auth.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { routerPaths } from '@/router/router-paths';
55
import type { AuthenticatedUserContextType } from '@/auth/auth-context';
66
import { PageCardLoader } from '@/components/ui/page-card';
77

8+
// eslint-disable-next-line react-refresh/only-export-components
89
export const AuthenticatedUserContext =
910
createContext<AuthenticatedUserContextType | null>(null);
1011

packages/apps/human-app/frontend/src/components/ui/table/table-header-cell.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@ export const TableHeaderCell = forwardRef<
4343

4444
const getHeader = () => {
4545
if (!iconType) {
46-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
4746
return <td onClick={handleClick} {...rest} />;
4847
}
4948
return (
50-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
5149
<td onClick={handleClick} {...rest}>
5250
<TextHeaderWithIcon iconType={iconType} text={headerText} />
5351
</td>

packages/apps/human-app/frontend/src/components/ui/table/table-query-context.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface TableQueryContext {
2222
};
2323
}
2424

25+
// eslint-disable-next-line react-refresh/only-export-components
2526
export const TableQueryContext = createContext<TableQueryContext>({
2627
actions: {
2728
setSorting: () => undefined,

0 commit comments

Comments
 (0)