Increase storybook pages coverage (#4885)
On FE: - refreshing metadata mocks - updating jest tests - fixing storybook pages coverage - fixing storybook modules coverage
This commit is contained in:
@ -35,14 +35,18 @@ type MockedActivity = Pick<
|
||||
| 'companyId'
|
||||
| 'targetObjectNameSingular'
|
||||
> & {
|
||||
activity: Pick<Activity, 'id' | 'createdAt' | 'updatedAt'>;
|
||||
person?: Pick<Person, 'id' | 'name' | 'avatarUrl'> | null;
|
||||
company?: Pick<Company, 'id' | 'name' | 'domainName'> | null;
|
||||
activity: Pick<Activity, 'id' | 'createdAt' | 'updatedAt' | '__typename'>;
|
||||
person?: Pick<Person, 'id' | 'name' | 'avatarUrl' | '__typename'> | null;
|
||||
company?: Pick<
|
||||
Company,
|
||||
'id' | 'name' | 'domainName' | '__typename'
|
||||
> | null;
|
||||
}
|
||||
>;
|
||||
};
|
||||
|
||||
const workspaceMember: WorkspaceMember = {
|
||||
__typename: 'WorkspaceMember',
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
@ -103,6 +107,7 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
personId: null,
|
||||
companyId: '89bb825c-171e-4bcc-9cf7-43448d6fb280',
|
||||
company: {
|
||||
__typename: 'Company',
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb280',
|
||||
name: 'Airbnb',
|
||||
domainName: 'airbnb.com',
|
||||
@ -110,6 +115,7 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
person: null,
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
activity: {
|
||||
__typename: 'Activity',
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
@ -124,6 +130,7 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
personId: null,
|
||||
companyId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
company: {
|
||||
__typename: 'Company',
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
name: 'Aircall',
|
||||
domainName: 'aircall.io',
|
||||
@ -131,6 +138,7 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
person: null,
|
||||
activityId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
activity: {
|
||||
__typename: 'Activity',
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb231',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
@ -166,6 +174,7 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
targetObjectNameSingular: 'person',
|
||||
personId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b', // Alexandre
|
||||
person: {
|
||||
__typename: 'Person',
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
|
||||
name: {
|
||||
firstName: 'Alexandre',
|
||||
@ -177,6 +186,7 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
companyId: null,
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
activity: {
|
||||
__typename: 'Activity',
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
@ -192,6 +202,7 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
targetObjectNameSingular: 'person',
|
||||
company: null,
|
||||
person: {
|
||||
__typename: 'Person',
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6d',
|
||||
name: {
|
||||
firstName: 'Jean',
|
||||
@ -201,6 +212,7 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
},
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
activity: {
|
||||
__typename: 'Activity',
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
|
||||
@ -11,6 +11,7 @@ type MockedCompany = Omit<Company, 'deletedAt'> & {
|
||||
|
||||
export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
{
|
||||
__typename: 'Company',
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
domainName: 'airbnb.com',
|
||||
name: 'Airbnb',
|
||||
@ -31,6 +32,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
Favorite: null,
|
||||
accountOwnerId: mockedUsersData[0].id,
|
||||
accountOwner: {
|
||||
__typename: 'WorkspaceMember',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
@ -46,6 +48,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
},
|
||||
},
|
||||
{
|
||||
__typename: 'Company',
|
||||
id: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
domainName: 'aircall.io',
|
||||
name: 'Aircall',
|
||||
@ -68,6 +71,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
Favorite: null,
|
||||
},
|
||||
{
|
||||
__typename: 'Company',
|
||||
id: 'a674fa6c-1455-4c57-afaf-dd5dc086361d',
|
||||
domainName: 'algolia.com',
|
||||
name: 'Algolia',
|
||||
@ -90,6 +94,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
accountOwnerId: null,
|
||||
},
|
||||
{
|
||||
__typename: 'Company',
|
||||
id: 'b1cfd51b-a831-455f-ba07-4e30671e1dc3',
|
||||
domainName: 'apple.com',
|
||||
name: 'Apple',
|
||||
@ -112,6 +117,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
accountOwnerId: null,
|
||||
},
|
||||
{
|
||||
__typename: 'Company',
|
||||
id: '5c21e19e-e049-4393-8c09-3e3f8fb09ecb',
|
||||
domainName: 'qonto.com',
|
||||
name: 'Qonto',
|
||||
@ -134,6 +140,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
accountOwnerId: null,
|
||||
},
|
||||
{
|
||||
__typename: 'Company',
|
||||
id: '9d162de6-cfbf-4156-a790-e39854dcd4eb',
|
||||
domainName: 'facebook.com',
|
||||
name: 'Facebook',
|
||||
@ -156,6 +163,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
accountOwnerId: null,
|
||||
},
|
||||
{
|
||||
__typename: 'Company',
|
||||
id: '9d162de6-cfbf-4156-a790-e39854dcd4ef',
|
||||
domainName: 'sequoia.com',
|
||||
name: 'Sequoia',
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
export const mockedClientConfig = {
|
||||
import { ClientConfig } from '~/generated-metadata/graphql';
|
||||
|
||||
export const mockedClientConfig: ClientConfig = {
|
||||
signInPrefilled: true,
|
||||
signUpDisabled: false,
|
||||
dataModelSettingsEnabled: true,
|
||||
developersSettingsEnabled: true,
|
||||
debugMode: false,
|
||||
authProviders: {
|
||||
google: true,
|
||||
@ -20,6 +20,12 @@ export const mockedClientConfig = {
|
||||
supportFrontChatId: null,
|
||||
__typename: 'Support',
|
||||
},
|
||||
sentry: {
|
||||
dsn: 'MOCKED_DSN',
|
||||
release: 'MOCKED_RELEASE',
|
||||
environment: 'MOCKED_ENVIRONMENT',
|
||||
__typename: 'Sentry',
|
||||
},
|
||||
billing: {
|
||||
isBillingEnabled: true,
|
||||
billingUrl: '',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,7 @@ type MockedUser = Pick<
|
||||
workspaceMember: WorkspaceMember | null;
|
||||
locale: string;
|
||||
defaultWorkspace: Workspace;
|
||||
workspaces: Array<{ workspace: Workspace }>;
|
||||
};
|
||||
|
||||
export const avatarUrl =
|
||||
@ -30,12 +31,39 @@ export const mockDefaultWorkspace: Workspace = {
|
||||
allowImpersonation: true,
|
||||
subscriptionStatus: 'active',
|
||||
activationStatus: 'active',
|
||||
featureFlags: [],
|
||||
featureFlags: [
|
||||
{
|
||||
id: '1492de61-5018-4368-8923-4f1eeaf988c4',
|
||||
key: 'IS_AIRTABLE_INTEGRATION_ENABLED',
|
||||
value: true,
|
||||
workspaceId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6w',
|
||||
},
|
||||
{
|
||||
id: '1492de61-5018-4368-8923-4f1eeaf988c5',
|
||||
key: 'IS_POSTGRESQL_INTEGRATION_ENABLED',
|
||||
value: true,
|
||||
workspaceId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6w',
|
||||
},
|
||||
{
|
||||
id: '1492de61-5018-4368-8923-4f1eeaf988c6',
|
||||
key: 'IS_CALENDER_ENABLED',
|
||||
value: true,
|
||||
workspaceId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6w',
|
||||
},
|
||||
],
|
||||
createdAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
currentCacheVersion: '1',
|
||||
currentBillingSubscription: {
|
||||
__typename: 'BillingSubscription',
|
||||
id: '7efbc3f7-6e5e-4128-957e-8d86808cdf6a',
|
||||
interval: 'month',
|
||||
status: 'active',
|
||||
},
|
||||
};
|
||||
|
||||
export const mockedWorkspaceMemberData: WorkspaceMember = {
|
||||
__typename: 'WorkspaceMember',
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
|
||||
colorScheme: 'Light',
|
||||
avatarUrl,
|
||||
@ -63,6 +91,7 @@ export const mockedUsersData: Array<MockedUser> = [
|
||||
workspaceMember: mockedWorkspaceMemberData,
|
||||
defaultWorkspace: mockDefaultWorkspace,
|
||||
locale: 'en',
|
||||
workspaces: [{ workspace: mockDefaultWorkspace }],
|
||||
},
|
||||
{
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6c',
|
||||
@ -84,6 +113,7 @@ export const mockedUsersData: Array<MockedUser> = [
|
||||
},
|
||||
defaultWorkspace: mockDefaultWorkspace,
|
||||
locale: 'en',
|
||||
workspaces: [{ workspace: mockDefaultWorkspace }],
|
||||
},
|
||||
];
|
||||
|
||||
@ -109,6 +139,7 @@ export const mockedOnboardingUsersData: Array<MockedUser> = [
|
||||
},
|
||||
defaultWorkspace: mockDefaultWorkspace,
|
||||
locale: 'en',
|
||||
workspaces: [{ workspace: mockDefaultWorkspace }],
|
||||
},
|
||||
{
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6d',
|
||||
@ -123,5 +154,6 @@ export const mockedOnboardingUsersData: Array<MockedUser> = [
|
||||
activationStatus: 'inactive',
|
||||
},
|
||||
locale: 'en',
|
||||
workspaces: [{ workspace: mockDefaultWorkspace }],
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user