Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frontend tests #6585

Merged
merged 7 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type ContainerProps = {
const StyledContainer = styled.div<ContainerProps>`
align-items: center;
background-color: ${({ theme, isOn, color }) =>
isOn ? color ?? theme.color.blue : theme.background.quaternary};
isOn ? (color ?? theme.color.blue) : theme.background.quaternary};
border-radius: 10px;
cursor: pointer;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { loggerLink } from '../utils';
const logger = loggerLink(() => 'Twenty');

export interface Options<TCacheShape> extends ApolloClientOptions<TCacheShape> {
onError?: (err: GraphQLFormattedError | undefined) => void;
onError?: (err: readonly GraphQLFormattedError[] | undefined) => void;
onNetworkError?: (err: Error | ServerParseError | ServerError) => void;
onTokenPairChange?: (tokenPair: AuthTokenPair) => void;
onUnauthenticatedError?: () => void;
Expand Down Expand Up @@ -80,9 +80,8 @@ export class ApolloFactory<TCacheShape> implements ApolloManager<TCacheShape> {
const errorLink = onError(
({ graphQLErrors, networkError, forward, operation }) => {
if (isDefined(graphQLErrors)) {
onErrorCb?.(graphQLErrors);
for (const graphQLError of graphQLErrors) {
onErrorCb?.(graphQLError);

if (graphQLError.message === 'Unauthorized') {
return fromPromise(
renewToken(uri, this.tokenPair)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7918,7 +7918,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "fieldEdge",
"node": {
"__typename": "field",
"id": "af19a3ba-b725-4b9d-a0b7-8bf6b04fadbf",
"id": "5dcef112-ce1b-46c1-a33a-4d1394628c34",
"type": "DATE_TIME",
"name": "updatedAt",
"label": "Update date",
Expand All @@ -7941,7 +7941,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "fieldEdge",
"node": {
"__typename": "field",
"id": "af19a3ba-b725-4b9d-a0b7-8bf6b04fadds",
"id": "277d8939-1ead-4cdb-a560-854644219779",
"type": "MULTI_SELECT",
"name": "testMultiSelect",
"label": "Test Multi Select",
Expand All @@ -7964,7 +7964,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "fieldEdge",
"node": {
"__typename": "field",
"id": "tt929592-4f74-419e-8b26-6d216859078f",
"id": "f207dd14-f05e-4f29-b222-8993d4680f31",
"type": "RAW_JSON",
"name": "testRawJson",
"label": "Test Raw Json",
Expand All @@ -7987,7 +7987,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "fieldEdge",
"node": {
"__typename": "field",
"id": "vv929592-4f74-419e-8b26-6d216859078f",
"id": "81db846a-a2f9-4b31-8931-81fac5cdd1b6",
"type": "RATING",
"name": "testRating",
"label": "Rating",
Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-front/src/testing/mock-data/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const customObjectMetadataItemEdge: ObjectEdge = {
color: 'yellow',
},
{
id: '3',
id: '6f6e1421-8a42-4d4a-bf76-465b5f84b6d2',
value: 'HIGH',
label: 'High',
color: 'red',
Expand Down
Loading