163c96c2e5
# Introduction Also now validating the workspace version when running a sync manifest <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/22625?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
26 lines
834 B
TypeScript
26 lines
834 B
TypeScript
import { extractRecordIdsAndDatesAsExpectAny } from 'test/utils/extract-record-ids-and-dates-as-expect-any';
|
|
import { isDefined } from 'twenty-shared/utils';
|
|
|
|
import { type BaseGraphQLError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
|
|
|
|
export const expectOneNotInternalServerErrorSnapshot = ({
|
|
errors,
|
|
normalizeMessage,
|
|
}: {
|
|
errors: BaseGraphQLError[];
|
|
normalizeMessage?: (message: string) => string;
|
|
}) => {
|
|
expect(errors.length).toBe(1);
|
|
const [firstError] = errors;
|
|
|
|
expect(firstError.extensions.code).not.toBe('INTERNAL_SERVER_ERROR');
|
|
|
|
const errorForSnapshot = isDefined(normalizeMessage)
|
|
? { ...firstError, message: normalizeMessage(firstError.message) }
|
|
: firstError;
|
|
|
|
expect(errorForSnapshot).toMatchSnapshot(
|
|
extractRecordIdsAndDatesAsExpectAny(errorForSnapshot),
|
|
);
|
|
};
|