Media reporting e2e tests, single audio support, style updates, and accessibility improvements #1276
Conversation
<header class="flex flex-row justify-between items-center mb-6"> | ||
<h4 class="text-base lg:text-3xl"> | ||
{{ $t('audio-details.information') }} | ||
</h4> | ||
<VContentReportPopover :media="audio" /> | ||
</header> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds the report form and button to the single audio results.
class="report-button font-semibold text-dark-charcoal-70" | ||
> | ||
<span class="md:hidden">{{ | ||
<span class="text-sr md:text-base md:hidden">{{ | ||
$t('media-details.content-report.short') | ||
}}</span> | ||
<span class="hidden md:inline">{{ | ||
<span class="text-sr md:text-base hidden md:inline">{{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:disabled="isSubmitDisabled" | ||
:focusable-when-disabled="true" | ||
variant="secondary" | ||
@click="handleSubmit" | ||
:value="$t('media-details.content-report.form.submit')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun fact: Playwright's selectors for text (page.locate('text="Submit"')
, for example) use the value
attribute when applied to submit buttons, not the actual button text contents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL! I guess we should add value
attribute to all the submit buttons? I wonder if it uses value
for all buttons...
@@ -166,11 +167,13 @@ export default defineComponent({ | |||
const isSubmitDisabled = computed( | |||
() => selectedReason.value === OTHER && description.value.length < 20 | |||
) | |||
const handleSubmit = async () => { | |||
const handleSubmit = async (event) => { | |||
event.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event.preventDefault()
Prevents redirection to the api POST request endpoint.
What do you mean by this? As long as there are tapes for the search requests then they are mocked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just reviewing the code so far. E2e tests look good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
@sarayourfriend I wrote this before I fully understood the tapes 😅 disregard! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvements in the way the report sets the mediaType, and overall report style and flow.
I wonder why I can't see the CI run information?
PS: I merged the main into this branch, and CI is all green!
if (selectedReason.value === DMCA) return | ||
// Submit report | ||
try { | ||
await service.sendReport({ | ||
mediaType: props.media.frontendMediaType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep forgetting that we can use the frontendMediaType
property!
# Conflicts: # src/locales/po-files/openverse.pot
Description
This PR makes a number of improvements to the reporting media code:
type="button"
button.media.frontendMediaType
property to the reporting service to make the form work with all media tyesI would love some heavy attention applied to the e2e tests. These tests run each type of report (dmca, mature, and other) on the first search result each media-specific search endpoint (
search/images
, for example). This tests the entire flow, like this:Currently the tests mock the various network requests made by the reporting form: the google docs form and the api reporting endpoint. There are also likely utilities in this test that could be used elsewhere, if you have any suggestions for those.
Testing Instructions
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin