Skip to content

docs: add reference to applyAccept from upload() #1144

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

Merged
merged 2 commits into from
Aug 29, 2022
Merged
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions docs/user-event/api-utility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ upload(

Change a file input as if a user clicked it and selected files in the resulting
file upload dialog.
Files that don't match an `accept` property will be automatically discarded,
unless [`applyAccept`](options.mdx#applyaccept) is set to `false`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: can we add this in an Admonitions?

Suggested change
Files that don't match an `accept` property will be automatically discarded,
unless [`applyAccept`](options.mdx#applyaccept) is set to `false`.
:::info
Files that don't match an `accept` property will be automatically discarded,
unless [`applyAccept`](options.mdx#applyaccept) is set to `false`.
:::

Copy link
Contributor Author

@khitrenovich khitrenovich Aug 26, 2022

Choose a reason for hiding this comment

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

We can, but I don't see it being used anywhere in the User Interactions area. Instead, I see quoting (>) is being used to mark notes (example), likely being the less visually-intrusive alternative. I can convert it to admonition, to a quote or just leave it as is - the decision would happen between you and @ph-fritsche , I guess.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, now that I've seen it on the preview website it looks good.
The reason why I mentioned it was because I would see myself looking at the docs exactly because files might be discarded and I wanted to know why. Hence, I thought it would be better that it would stand out. But it looks good now already.
@ph-fritsche you got the final say here :)

Copy link
Member

Choose a reason for hiding this comment

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

I would make this a new paragraph. The other sections start with a very short description of what the API does. Often just the name of the API used in a proper sentence.
This might not make for the best novel read, but it is easy to follow when skim reading.

The admonitions stick out. I'd reserve them for information that doesn't "fit in the story" but is too important to be just placed somewhere else.

But I'm fine with it either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with what I read above - people will come to see the docs "exactly because files might be discarded", so the note should be "easy to follow when skim reading", but not "stick out". I think quoting makes the best balance, and it is already extensively used in the other paragraphs of the same file. I've made the adjustment, LMK if that looks better. I'm happy to tweak it further if needed.


```jsx
test('upload file', async () => {
Expand Down