Remove onboarding flashes + close all dropdowns on CommandMenu close (#11483)
## Remove onboarding flashes Tested: - sign in with credentials - sign in with social oAuth - sign up with credentials - multidomain - single domain - reset password No more flashes, and code logic simplified! ## Close all dropdowns on CommandMenu close Before: https://github.com/user-attachments/assets/244ff935-3d40-47d5-a097-12d4cc3810dd After: https://github.com/user-attachments/assets/1de692f8-5032-404a-be74-025ebca67138 --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -9,7 +9,7 @@ import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewCompon
|
||||
import { MockedResponse } from '@apollo/client/testing';
|
||||
import gql from 'graphql-tag';
|
||||
import { getJestMetadataAndApolloMocksWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksWrapper';
|
||||
import { getPeopleRecordConnectionMock } from '~/testing/mock-data/people';
|
||||
import { peopleQueryResult } from '~/testing/mock-data/people';
|
||||
|
||||
const recordTableId = 'people';
|
||||
const objectNameSingular = 'person';
|
||||
@ -82,6 +82,7 @@ const mocks: MockedResponse[] = [
|
||||
employees
|
||||
id
|
||||
idealCustomerProfile
|
||||
internalCompetitions
|
||||
introVideo {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
@ -203,6 +204,67 @@ const mocks: MockedResponse[] = [
|
||||
personId
|
||||
pet {
|
||||
__typename
|
||||
age
|
||||
averageCostOfKibblePerMonth {
|
||||
amountMicros
|
||||
currencyCode
|
||||
}
|
||||
bio
|
||||
birthday
|
||||
comments
|
||||
createdAt
|
||||
createdBy {
|
||||
source
|
||||
workspaceMemberId
|
||||
name
|
||||
context
|
||||
}
|
||||
deletedAt
|
||||
extraData
|
||||
id
|
||||
interestingFacts
|
||||
isGoodWithKids
|
||||
location {
|
||||
addressStreet1
|
||||
addressStreet2
|
||||
addressCity
|
||||
addressState
|
||||
addressCountry
|
||||
addressPostcode
|
||||
addressLat
|
||||
addressLng
|
||||
}
|
||||
makesOwnerThinkOf {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
name
|
||||
pictures {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
position
|
||||
soundSwag
|
||||
species
|
||||
traits
|
||||
updatedAt
|
||||
vetEmail {
|
||||
primaryEmail
|
||||
additionalEmails
|
||||
}
|
||||
vetPhone {
|
||||
primaryPhoneNumber
|
||||
primaryPhoneCountryCode
|
||||
primaryPhoneCallingCode
|
||||
additionalPhones
|
||||
}
|
||||
}
|
||||
petId
|
||||
surveyResult {
|
||||
__typename
|
||||
averageEstimatedNumberOfAtomsInTheUniverse
|
||||
comments
|
||||
createdAt
|
||||
createdBy {
|
||||
source
|
||||
@ -213,10 +275,13 @@ const mocks: MockedResponse[] = [
|
||||
deletedAt
|
||||
id
|
||||
name
|
||||
participants
|
||||
percentageOfCompletion
|
||||
position
|
||||
score
|
||||
shortNotes
|
||||
updatedAt
|
||||
}
|
||||
petId
|
||||
surveyResultId
|
||||
updatedAt
|
||||
}
|
||||
@ -260,6 +325,7 @@ const mocks: MockedResponse[] = [
|
||||
employees
|
||||
id
|
||||
idealCustomerProfile
|
||||
internalCompetitions
|
||||
introVideo {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
@ -364,6 +430,67 @@ const mocks: MockedResponse[] = [
|
||||
personId
|
||||
pet {
|
||||
__typename
|
||||
age
|
||||
averageCostOfKibblePerMonth {
|
||||
amountMicros
|
||||
currencyCode
|
||||
}
|
||||
bio
|
||||
birthday
|
||||
comments
|
||||
createdAt
|
||||
createdBy {
|
||||
source
|
||||
workspaceMemberId
|
||||
name
|
||||
context
|
||||
}
|
||||
deletedAt
|
||||
extraData
|
||||
id
|
||||
interestingFacts
|
||||
isGoodWithKids
|
||||
location {
|
||||
addressStreet1
|
||||
addressStreet2
|
||||
addressCity
|
||||
addressState
|
||||
addressCountry
|
||||
addressPostcode
|
||||
addressLat
|
||||
addressLng
|
||||
}
|
||||
makesOwnerThinkOf {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
name
|
||||
pictures {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
position
|
||||
soundSwag
|
||||
species
|
||||
traits
|
||||
updatedAt
|
||||
vetEmail {
|
||||
primaryEmail
|
||||
additionalEmails
|
||||
}
|
||||
vetPhone {
|
||||
primaryPhoneNumber
|
||||
primaryPhoneCountryCode
|
||||
primaryPhoneCallingCode
|
||||
additionalPhones
|
||||
}
|
||||
}
|
||||
petId
|
||||
surveyResult {
|
||||
__typename
|
||||
averageEstimatedNumberOfAtomsInTheUniverse
|
||||
comments
|
||||
createdAt
|
||||
createdBy {
|
||||
source
|
||||
@ -374,10 +501,13 @@ const mocks: MockedResponse[] = [
|
||||
deletedAt
|
||||
id
|
||||
name
|
||||
participants
|
||||
percentageOfCompletion
|
||||
position
|
||||
score
|
||||
shortNotes
|
||||
updatedAt
|
||||
}
|
||||
petId
|
||||
surveyResultId
|
||||
task {
|
||||
__typename
|
||||
@ -423,7 +553,14 @@ const mocks: MockedResponse[] = [
|
||||
},
|
||||
result: jest.fn(() => ({
|
||||
data: {
|
||||
people: getPeopleRecordConnectionMock(),
|
||||
people: peopleQueryResult.people,
|
||||
pageInfo: {
|
||||
hasNextPage: false,
|
||||
hasPreviousPage: false,
|
||||
startCursor: null,
|
||||
endCursor: null,
|
||||
},
|
||||
totalCount: 16,
|
||||
},
|
||||
})),
|
||||
},
|
||||
@ -484,11 +621,11 @@ describe('useLazyLoadRecordIndexTable', () => {
|
||||
|
||||
expect(result.current.loading).toBe(false);
|
||||
|
||||
act(() => {
|
||||
result.current.findManyRecords();
|
||||
await act(async () => {
|
||||
await result.current.findManyRecords();
|
||||
});
|
||||
|
||||
expect(Array.isArray(result.current.records)).toBe(true);
|
||||
expect(result.current.records.length).toBe(13);
|
||||
expect(result.current.records.length).toBe(16);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user