Fix Frontend pages tests (#2719)
* Fix Frontend pages tests Co-authored-by: gitstart-twenty <twenty@gitstart.com> Co-authored-by: Mael FOSSO <fosso.mael.elvis@gmail.com> * Add SnackBarDecorator Co-authored-by: gitstart-twenty <twenty@gitstart.com> Co-authored-by: Mael FOSSO <fosso.mael.elvis@gmail.com> * Fix more tests Co-authored-by: gitstart-twenty <twenty@gitstart.com> Co-authored-by: Mael FOSSO <fosso.mael.elvis@gmail.com> * Fix more tests Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: gitstart-twenty <twenty@gitstart.com> Co-authored-by: Mael FOSSO <fosso.mael.elvis@gmail.com> --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Mael FOSSO <fosso.mael.elvis@gmail.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com>
This commit is contained in:
@ -2,11 +2,12 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import { ApiKeyInput } from '@/settings/developers/components/ApiKeyInput';
|
||||
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
|
||||
import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
|
||||
|
||||
const meta: Meta<typeof ApiKeyInput> = {
|
||||
title: 'Pages/Settings/Developers/ApiKeys/ApiKeyInput',
|
||||
component: ApiKeyInput,
|
||||
decorators: [ComponentDecorator],
|
||||
decorators: [ComponentDecorator, SnackBarDecorator],
|
||||
args: {
|
||||
apiKey:
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0d2VudHktN2VkOWQyMTItMWMyNS00ZDAyLWJmMjUtNmFlY2NmN2VhNDE5IiwiaWF0IjoxNjk4MTQyODgyLCJleHAiOjE2OTk0MDE1OTksImp0aSI6ImMyMmFiNjQxLTVhOGYtNGQwMC1iMDkzLTk3MzUwYTM2YzZkOSJ9.JIe2TX5IXrdNl3n-kRFp3jyfNUE7unzXZLAzm2Gxl98',
|
||||
|
||||
@ -34,10 +34,10 @@ export const NameFields = ({
|
||||
);
|
||||
|
||||
const [firstName, setFirstName] = useState(
|
||||
currentWorkspaceMember?.name.firstName ?? '',
|
||||
currentWorkspaceMember?.name?.firstName ?? '',
|
||||
);
|
||||
const [lastName, setLastName] = useState(
|
||||
currentWorkspaceMember?.name.lastName ?? '',
|
||||
currentWorkspaceMember?.name?.lastName ?? '',
|
||||
);
|
||||
|
||||
const { updateOneObject, objectNotFoundInMetadata } =
|
||||
@ -91,8 +91,8 @@ export const NameFields = ({
|
||||
}
|
||||
|
||||
if (
|
||||
currentWorkspaceMember.name.firstName !== firstName ||
|
||||
currentWorkspaceMember.name.lastName !== lastName
|
||||
currentWorkspaceMember.name?.firstName !== firstName ||
|
||||
currentWorkspaceMember.name?.lastName !== lastName
|
||||
) {
|
||||
debouncedUpdate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user