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 front jest tests #5331

Merged
merged 14 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .github/workflows/actions/task-cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ runs:
.nx/cache
node_modules/.cache
packages/*/node_modules/.cache
packages/twenty-front/storybook-static
key: tasks-cache-${{ github.ref_name }}-${{ inputs.tag }}-${{ steps.tasks-key.outputs.key }}${{ inputs.suffix }}-${{ github.sha }}
restore-keys: |
tasks-cache-${{ github.ref_name }}-${{ inputs.tag }}-${{ steps.tasks-key.outputs.key }}${{ inputs.suffix }}-
2 changes: 1 addition & 1 deletion .github/workflows/ci-front.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:

jobs:
front-sb-build:
runs-on: ubuntu-latest
runs-on: ci-8-cores
env:
REACT_APP_SERVER_BASE_URL: http://localhost:3000
steps:
Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-front/nyc.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const modulesCoverage = {
};

const pagesCoverage = {
branches: 45,
branches: 40,
statements: 60,
lines: 60,
functions: 45,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { gql } from '@apollo/client';
import { mockedPeopleData } from '~/testing/mock-data/people';

export const query = gql`
query FindDuplicatePerson($id: UUID) {
query FindDuplicatePerson($id: ID!) {
personDuplicates(id: $id) {
edges {
node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ const expectedQueryTemplate = `
describe('useCreateManyRecordsMutation', () => {
it('should return a valid createManyRecordsMutation', () => {
const objectNameSingular = 'person';
const depth = 2;

const { result } = renderHook(
() =>
useCreateManyRecordsMutation({
objectNameSingular,
depth,
}),
{
wrapper: RecoilRoot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ const expectedQueryTemplate = `
describe('useCreateOneRecordMutation', () => {
it('should return a valid createOneRecordMutation', () => {
const objectNameSingular = 'person';
const depth = 2;

const { result } = renderHook(
() =>
useCreateOneRecordMutation({
objectNameSingular,
depth,
}),
{
wrapper: RecoilRoot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { RecoilRoot } from 'recoil';
import { useDeleteOneRecordMutation } from '@/object-record/hooks/useDeleteOneRecordMutation';

const expectedQueryTemplate = `
mutation DeleteOnePerson($idToDelete: UUID!) {
mutation DeleteOnePerson($idToDelete: ID!) {
deletePerson(id: $idToDelete) {
id
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { RecoilRoot } from 'recoil';
import { useExecuteQuickActionOnOneRecordMutation } from '@/object-record/hooks/useExecuteQuickActionOnOneRecordMutation';

const expectedQueryTemplate = `
mutation ExecuteQuickActionOnOnePerson($idToExecuteQuickActionOn: UUID!) {
mutation ExecuteQuickActionOnOnePerson($idToExecuteQuickActionOn: ID!) {
executeQuickActionOnPerson(id: $idToExecuteQuickActionOn) {
__typename
xLink {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { RecoilRoot } from 'recoil';
import { useFindDuplicateRecordsQuery } from '@/object-record/hooks/useFindDuplicatesRecordsQuery';

const expectedQueryTemplate = `
query FindDuplicatePerson($id: UUID) {
query FindDuplicatePerson($id: ID!) {
personDuplicates(id: $id) {
edges {
node {
Expand Down Expand Up @@ -47,13 +47,11 @@ const expectedQueryTemplate = `
describe('useFindDuplicateRecordsQuery', () => {
it('should return a valid findDuplicateRecordsQuery', () => {
const objectNameSingular = 'person';
const depth = 2;

const { result } = renderHook(
() =>
useFindDuplicateRecordsQuery({
objectNameSingular,
depth,
}),
{
wrapper: RecoilRoot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { RecoilRoot } from 'recoil';
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';

const expectedQueryTemplate = `
query FindManyPeople($filter: PersonFilterInput, $orderBy: PersonOrderByInput, $lastCursor: String, $limit: Float) {
query FindManyPeople($filter: PersonFilterInput, $orderBy: PersonOrderByInput, $lastCursor: String, $limit: Int) {
people(filter: $filter, orderBy: $orderBy, first: $limit, after: $lastCursor) {
edges {
node {
Expand Down Expand Up @@ -47,14 +47,12 @@ const expectedQueryTemplate = `
describe('useFindManyRecordsQuery', () => {
it('should return a valid findManyRecordsQuery', () => {
const objectNameSingular = 'person';
const depth = 2;
const computeReferences = true;

const { result } = renderHook(
() =>
useFindManyRecordsQuery({
objectNameSingular,
depth,
computeReferences,
}),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { RecoilRoot } from 'recoil';
import { useFindOneRecordQuery } from '@/object-record/hooks/useFindOneRecordQuery';

const expectedQueryTemplate = `
query FindOnePerson($objectRecordId: UUID!) {
query FindOnePerson($objectRecordId: ID!) {
person(filter: { id: { eq: $objectRecordId } }) {
__typename
xLink {
Expand Down Expand Up @@ -36,13 +36,11 @@ query FindOnePerson($objectRecordId: UUID!) {
describe('useFindOneRecordQuery', () => {
it('should return a valid findOneRecordQuery', () => {
const objectNameSingular = 'person';
const depth = 2;

const { result } = renderHook(
() =>
useFindOneRecordQuery({
objectNameSingular,
depth,
}),
{
wrapper: RecoilRoot,
Expand Down
Loading