Skip to content

Commit

Permalink
Fix walk_change_start_time acceptance feature #248
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfausk committed Jan 10, 2025
1 parent ad2e01f commit 607865d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
16 changes: 12 additions & 4 deletions web/assets/js/components/Walk/WalkUnfinishedForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,19 @@

<script>
'use strict';
import dayjs from 'dayjs';
import FormError from '../Common/FormError.vue';
import FormGroup from '../Common/FormGroup.vue';
import {useTeamStore, useUserStore, useWalkStore, useWayPointStore} from '../../stores';
import {WalkConceptOfDayField, WalkGuestNamesField, WalkHolidaysField, WalkNameField, WalkStartTimeField, WalkTeamMembersField, WalkWalkCreatorField, WalkWeatherField} from "../Common/Walk";
import {
WalkConceptOfDayField,
WalkGuestNamesField,
WalkHolidaysField,
WalkNameField,
WalkStartTimeField,
WalkTeamMembersField,
WalkWalkCreatorField,
WalkWeatherField
} from "../Common/Walk";
export default {
name: 'WalkUnfinishedForm',
Expand Down Expand Up @@ -130,7 +138,7 @@ export default {
|| !this.walk.conceptOfDay
|| !this.walk.startTime
|| !this.walk.walkTeamMembers.length
|| !this.walk.walkCreator
|| !this.walk.walkCreator && this.initialWalk.walkCreator
|| !this.walk.weather
|| this.isLoading;
},
Expand Down Expand Up @@ -169,7 +177,7 @@ export default {
return !this.walk.name
|| !this.walk.conceptOfDay
|| !this.walk.startTime
|| !this.walk.walkCreator
|| !this.walk.walkCreator && this.initialWalk.walkCreator
|| this.isLoading;
},
error() {
Expand Down
19 changes: 6 additions & 13 deletions web/tests/Acceptance/features/walk_change_start_time.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: An administrator can change startTime of a walk
| Drogen | Blue | client@gmx.de |
Given the following walks exists:
| name | team | startTime | endTime | reflection | systemicAnswer | commitments | insights |
| Klippe | Westhang | 02.01.2021 7:20 | 10.01.2021 09:00 | zorp | zorp | zorp | zorp |
| Klippe | Westhang | 02.01.2021 7:20 | 10.01.2021 19:00 | zorp | zorp | zorp | zorp |

@javascript
@walkChange @startTime
Expand All @@ -29,23 +29,16 @@ Feature: An administrator can change startTime of a walk
When I go to swapp page "/runde/walkId<Klippe>/detail"
Then I wait for 'Runde "Klippe" ändern' to appear

When I click on test element "startTimeTime"
Then I wait for 'Schließen' to appear
When I click on aria label "Erhöhen"

When I click on test element "startTimeDate"
Then I wait for 'Mit den Pfeiltasten durch den Kalender navigieren' to appear
When I click on aria label "Sonntag, 10. Januar 2021"

When I select date "10.01.2021" in date selector "startTimeDate"
When I select time "18:20" in time selector "startTimeTime"
When I enter "Sonne" in "Wetter" field

When I click on test element "button-walk-submit"

Then I wait for 'Runde "Klippe" wurde erfolgreich geändert.' to appear


Then I can find the following walks in database:
| name | startTime | endTime |
| Klippe | date<10.01.2021 8:20,d.m.Y H:i:s> | date<10.01.2021 9:00,d.m.Y H:i:s> |

| name | startTime | endTime | weather |
| Klippe | date<10.01.2021 18:20,d.m.Y H:i:s> | date<10.01.2021 19:00,d.m.Y H:i:s> | Sonne |

And there are exactly 1 walks in database
3 changes: 3 additions & 0 deletions web/tests/Context/DomainIntegrationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,9 @@ public function iCanFindTheFollowingWalksInDatabase(TableNode $table): void
if (isset($row['walkReflection'])) {
Assert::same($walk->getWalkReflection(), $this->enrichText($row['walkReflection']));
}
if (isset($row['weather'])) {
Assert::same($walk->getWeather(), $this->enrichText($row['weather']));
}
if (isset($row['rating']) && '' !== $row['rating']) {
Assert::same(
$walk->getRating(),
Expand Down

0 comments on commit 607865d

Please sign in to comment.