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

Cody/change entry name #657

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Cody/change entry name #657

wants to merge 12 commits into from

Conversation

kepsteen
Copy link
Contributor

@kepsteen kepsteen commented Nov 14, 2024

Closes #634

  • added edit button to Entry Name
  • created entryNameForm
    • added zod validation that string must be between 3 and 50 characters
  • created updateEntryName function to update the Document in DB
  • created onSubmit function to call updateEntryName and update state
  • wrote unit tests for new functionality

Recording 2024-11-18 at 16 58 54

Copy link

appwrite bot commented Nov 14, 2024

Gridiron Survivor Application 6616ea581ef9f5521c7d

Function ID Status Action
Your function has been successfully deployed.

Project name: Gridiron Survivor Application
Project ID: 6616ea581ef9f5521c7d

Function ID Status Action
userAuth 6626fef885a9f630442b ready Ready View Logs

Only deployments on the production branch are activated automatically. If you'd like to activate this deployment, navigate to your deployments. Learn more about Appwrite Function deployments.

💡 Did you know?
Appwrite has a Discord community with over 16 000 members. Come join us!

Copy link

vercel bot commented Nov 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gridiron-survivor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 1:22am
gridiron-survivor-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 1:22am

api/apiFunctions.ts Outdated Show resolved Hide resolved
api/apiFunctions.ts Outdated Show resolved Hide resolved
data,
): Promise<void> => {
const { name } = data;
const entryId: string = entry;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't, I'll fix it

fireEvent.click(screen.getByTestId('edit-entry-name-button'));

const entryNameInput = screen.getByTestId('entry-name-input');
const cancelButton = screen.getByLabelText('Cancel Editing');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not grab elements by text. If the text changes, this test will fail. Instead, add data-testid attribute. This is a unique ID that won't ever change. On top of this, when we add localization, things won't always be in English.

});

const input = screen.getByTestId('entry-name-input');
fireEvent.change(input, { target: { value: 'New Entry Name' } });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Add a data-testid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability for user to change Entry's name
3 participants