Skip to content

Commit

Permalink
Merge pull request #1102 from danskernesdigitalebibliotek/DDFFORM-559…
Browse files Browse the repository at this point in the history
…-tests-pa-abningstider-testning-af-redigering-af-abningstider

Ddfform 559 tests pa abningstider testning af redigering af abningstider
  • Loading branch information
kasperbirch1 authored Apr 10, 2024
2 parents 0c2ec47 + f633041 commit 6f6858c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/apps/opening-hours-editor/DialogFormEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const DialogFormEdit: React.FC<DialogFormEditProps> = ({
openingHoursCategories={openingHoursCategories}
>
<button
data-cy="opening-hours-editor-form__remove"
className="opening-hours-editor-form__remove"
type="button"
tabIndex={0}
Expand Down
10 changes: 9 additions & 1 deletion src/apps/opening-hours-editor/EventForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,19 @@ const EventForm: React.FC<EventFormProps> = ({
};

return (
<form onSubmit={handleSubmit} className="opening-hours-editor-form">
<form
onSubmit={handleSubmit}
className="opening-hours-editor-form"
data-cy="opening-hours-editor-form"
>
<label
className="opening-hours-editor-form__label"
htmlFor="event-form-title"
>
{t("openingHoursEventFormTitleText")}
</label>
<select
data-cy="opening-hours-editor-form-select"
className="opening-hours-editor-form__select"
id="event-form-title"
value={category?.title}
Expand All @@ -84,6 +89,7 @@ const EventForm: React.FC<EventFormProps> = ({
{t("openingHoursEventFormStartTimeText")}
</label>
<input
data-cy="opening-hours-editor-form-start-time"
className="opening-hours-editor-form__time-input"
id="event-form-start-time"
type="time"
Expand All @@ -97,6 +103,7 @@ const EventForm: React.FC<EventFormProps> = ({
{t("openingHoursEventFormEndTimeText")}
</label>
<input
data-cy="opening-hours-editor-form-end-time"
className="opening-hours-editor-form__time-input"
id="event-form-end-time"
type="time"
Expand All @@ -107,6 +114,7 @@ const EventForm: React.FC<EventFormProps> = ({
/>
{children}
<button
data-cy="opening-hours-editor-form-submit"
type="submit"
className="opening-hours-editor-form__submit"
disabled={isSameTime}
Expand Down
2 changes: 1 addition & 1 deletion src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import serviceUrlArgs from "../../core/storybook/serviceUrlArgs";
import OpeningHoursEditor from "./OpeningHoursEditor.entry";

export default {
title: "Apps / OpeningHoursEditor",
title: "Apps / Opening Hours Editor",
component: OpeningHoursEditor,
argTypes: {
...serviceUrlArgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const OpeningHoursEditorEventContent: React.FC<
> = ({ eventInput }) => {
const { event } = eventInput;
return (
<div className="opening-hours-editor-event-content">
<div
className="opening-hours-editor-event-content"
data-cy="opening-hours-editor-event-content"
>
<b>{event.title}</b>
<div>
{extractTime(event.start)} - {extractTime(event.end)}
Expand Down

0 comments on commit 6f6858c

Please sign in to comment.