Skip to content

Commit

Permalink
N21-1862 add data test ids (#3446)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBergCap authored May 3, 2024
1 parent e9c7feb commit 90b9a59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion views/courses/create-course.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
</div>
<div class="form-group col-md-6">
{{> "lib/forms/form-date-input" label=($t "global.label.to") id="untilDate" class="untilDate"
value=course.untilDate disabled=@root.syncedWithGroup}}
value=course.untilDate dataTestId="date_until" disabled=@root.syncedWithGroup}}
{{#if syncedWithGroup}}
<input type="hidden" id="untilDateSync" name="untilDate" value="{{untilDate}}">
{{/if}}
Expand Down
16 changes: 9 additions & 7 deletions views/courses/edit-course.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

<div class="form-group">
<label for="mathsClass">{{$t "global.label.nameOfTheCourse"}}</label>
<input id="mathsClass" class="form-control" name="name" type="text" placeholder="{{$t "courses.global.input.mathsClass"}}" value="{{course.name}}"
<input id="mathsClass" data-testid="coursename" class="form-control" name="name" type="text" placeholder="{{$t "courses.global.input.mathsClass"}}" value="{{course.name}}"
{{#if course.isArchived}}disabled{{/if}} required autofocus />
</div>

Expand Down Expand Up @@ -137,7 +137,7 @@

<div class="form-group">
<label for="teacherId">{{$t "administration.global.label.teachingTeacher"}}</label>
<select id="teacherId" name="teacherIds[]" required multiple data-placeholder="{{$t "courses.global.input.chooseTeacher"}}"
<select id="teacherId" name="teacherIds[]" data-testid="teachersearch" required multiple data-placeholder="{{$t "courses.global.input.chooseTeacher"}}"
{{#ifCond course.isArchived '||' course.syncedWithGroup}}disabled{{/ifCond}}>
{{#each teachers}}
<option value="{{this._id}}" {{#if this.selected}}selected{{/if}} {{#if this.isHidden}}hidden{{/if}}>
Expand All @@ -154,7 +154,7 @@

<div class="form-group">
<label for="substituteTeacher">{{$t "courses._course.edit.label.substitute"}}</label>
<select id="substituteTeacher" name="substitutionIds[]" multiple data-placeholder="{{$t "courses.global.input.chooseTeacher"}}"
<select id="substituteTeacher" name="substitutionIds[]" data-testid="substituent" multiple data-placeholder="{{$t "courses.global.input.chooseTeacher"}}"
{{#ifCond course.isArchived '||' course.syncedWithGroup}}disabled{{/ifCond}}>
{{#each substitutions}}
<option value="{{this._id}}" {{#if this.selected}}selected{{/if}} {{#if this.isHidden}}hidden{{/if}}>
Expand All @@ -170,7 +170,7 @@
<div class="form-group">
<label for="classId">{{$t "global.headline.classes"}} <small>{{$t "administration.global.label.afterSavingAllStudentsAdded"}}</small></label>

<select id="classId" name="classIds[]" multiple data-placeholder="{{$t "courses.global.input.selectClasses"}}"
<select id="classId" name="classIds[]" data-testid="classes" multiple data-placeholder="{{$t "courses.global.input.selectClasses"}}"
{{#ifCond course.isArchived '||' course.syncedWithGroup}}disabled{{/ifCond}}>
{{#each classesAndGroups}}
<option value="{{#if this._id}}{{this._id}}{{else}}{{this.id}}{{/if}}" {{#if this.selected}}selected{{/if}}>
Expand Down Expand Up @@ -205,7 +205,7 @@

<div class="form-group">
<label for="studentsId">{{$t "administration.global.label.studentParticipants"}}</label>
<select id="studentsId" name="userIds[]" multiple data-placeholder="{{$t "courses.global.input.selectStudents"}}"
<select id="studentsId" name="userIds[]" data-testid="pupils" multiple data-placeholder="{{$t "courses.global.input.selectStudents"}}"
{{#ifCond course.isArchived '||' course.syncedWithGroup}}disabled{{/ifCond}}>
{{#each students}}
<option value="{{this._id}}" {{#if this.selected}}selected{{/if}} {{#if this.isHidden}}hidden{{/if}}>
Expand All @@ -223,14 +223,16 @@
<label>{{$t "administration.global.label.timeSpan"}}</label>
<div class="row">
<div class="form-group col-md-6">
{{> "lib/forms/form-date-input" label=($t "global.label.from") id="startDate" value=course.startDate disabled=(isCond @root.course.isArchived '||' @root.course.syncedWithGroup) ariaLabel=($t "administration.global.label.chooseDate") }}
{{> "lib/forms/form-date-input" label=($t "global.label.from") id="startDate" dataTestId="date_start"
value=course.startDate disabled=(isCond @root.course.isArchived '||' @root.course.syncedWithGroup) ariaLabel=($t "administration.global.label.chooseDate") }}
</div>
{{#if course.syncedWithGroup}}
<input type="hidden" id="startDateSync" name="startDate" value="{{startDate}}">
{{/if}}

<div class="form-group col-md-6">
{{> "lib/forms/form-date-input" label=($t "global.label.to") id="untilDate" value=course.untilDate disabled=(isCond @root.course.isArchived '||' @root.course.syncedWithGroup) ariaLabel=($t "administration.global.label.chooseDate") }}
{{> "lib/forms/form-date-input" label=($t "global.label.to") id="untilDate" dataTestId="date_until"
value=course.untilDate disabled=(isCond @root.course.isArchived '||' @root.course.syncedWithGroup) ariaLabel=($t "administration.global.label.chooseDate") }}
</div>
{{#if course.syncedWithGroup}}
<input type="hidden" id="untilDateSync" name="untilDate" value="{{untilDate}}">
Expand Down

0 comments on commit 90b9a59

Please sign in to comment.