fix tests (proper timezone), proper spacing
All checks were successful
CI/CD Pipeline / test (push) Successful in 12m39s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
philipp 2024-04-15 21:32:16 +02:00
parent d070c7731a
commit 8315a27ea8
3 changed files with 5 additions and 5 deletions

View File

@ -81,7 +81,7 @@ test("Cox can start and finish trip", async ({ page }, testInfo) => {
const currentValue = await page.$eval(datetimeSelector, el => el.value); const currentValue = await page.$eval(datetimeSelector, el => el.value);
const currentDate = new Date(currentValue); const currentDate = new Date(currentValue);
currentDate.setMinutes(currentDate.getMinutes() + 1); currentDate.setMinutes(currentDate.getMinutes() + 1);
currentDate.setHours(currentDate.getHours() + 1); currentDate.setHours(currentDate.getHours() - new Date().getTimezoneOffset()/60);
const newDatetime = currentDate.toISOString().slice(0, 16); const newDatetime = currentDate.toISOString().slice(0, 16);
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime); await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
@ -165,7 +165,7 @@ test("Kiosk can start and finish trip", async ({ page }, testInfo) => {
const currentValue = await page.$eval(datetimeSelector, el => el.value); const currentValue = await page.$eval(datetimeSelector, el => el.value);
const currentDate = new Date(currentValue); const currentDate = new Date(currentValue);
currentDate.setMinutes(currentDate.getMinutes() + 1); currentDate.setMinutes(currentDate.getMinutes() + 1);
currentDate.setHours(currentDate.getHours() + 1); currentDate.setHours(currentDate.getHours() - new Date().getTimezoneOffset()/60);
const newDatetime = currentDate.toISOString().slice(0, 16); const newDatetime = currentDate.toISOString().slice(0, 16);
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime); await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);

View File

@ -505,7 +505,7 @@ ORDER BY departure DESC
let dep = NaiveDateTime::parse_from_str(&log.departure, "%Y-%m-%dT%H:%M").unwrap(); let dep = NaiveDateTime::parse_from_str(&log.departure, "%Y-%m-%dT%H:%M").unwrap();
let arr = NaiveDateTime::parse_from_str(&log.arrival, "%Y-%m-%dT%H:%M").unwrap(); let arr = NaiveDateTime::parse_from_str(&log.arrival, "%Y-%m-%dT%H:%M").unwrap();
if arr.timestamp() <= dep.timestamp() { if arr.timestamp() < dep.timestamp() {
return Err(LogbookUpdateError::ArrivalNotAfterDeparture); return Err(LogbookUpdateError::ArrivalNotAfterDeparture);
} }
let today = Local::now().date_naive(); let today = Local::now().date_naive();

View File

@ -223,10 +223,10 @@
Ruderer: Ruderer:
{% for rower in log.rowers -%} {% for rower in log.rowers -%}
{{ rower.name }} {{ rower.name }}
{% if rower.id == log.steering_user.id and rower.id != log.shipmaster_user.id %} {%- if rower.id == log.steering_user.id and rower.id != log.shipmaster_user.id %}
(Steuerperson){%- endif -%} (Steuerperson){%- endif -%}
{%- if not loop.last or amount_guests > 0 and log.boat.name != 'Externes Boot' %},{% endif %} {%- if not loop.last or amount_guests > 0 and log.boat.name != 'Externes Boot' %},{% endif %}
{% endfor %} {% endfor -%}
{% if amount_guests > 0 and log.boat.name != 'Externes Boot' %} {% if amount_guests > 0 and log.boat.name != 'Externes Boot' %}
Gäste Gäste
<small class="text-gray-600 dark:text-gray-100">(ohne Account)</small>: <small class="text-gray-600 dark:text-gray-100">(ohne Account)</small>: