fix existing flakiness + cut runtime closes #533 #544

Merged
moritz merged 11 commits from issue/mitgliederverwaltung-533 into main 2026-06-16 18:30:14 +02:00
Showing only changes of commit cb54c2c46e - Show all commits

View file

@ -20,11 +20,12 @@ defmodule MvWeb.MemberLive.Index.DateFilterPropertyTest do
# Generators -----------------------------------------------------------
defp optional_date_gen do
one_of([
constant(nil),
defp date_gen do
map(integer(-3650..3650), &Date.add(~D[2000-01-01], &1))
])
end
defp optional_date_gen do
one_of([constant(nil), date_gen()])
end
defp exit_date_mode_gen do
@ -57,19 +58,25 @@ defmodule MvWeb.MemberLive.Index.DateFilterPropertyTest do
# Property -------------------------------------------------------------
# Generates a {from, to} pair with at least one bound set. Built by construction
# (pick which bounds are set, then generate the required dates) rather than by
# filtering out the both-nil case, so StreamData never rejects values and cannot
# raise FilterTooNarrowError on unlucky seeds.
defp bound_pair_with_at_least_one_set_gen do
gen all(
from <- optional_date_gen(),
to <- optional_date_gen(),
from != nil or to != nil
which <- member_of([:from_only, :to_only, :both]),
date_a <- date_gen(),
date_b <- date_gen()
) do
{from, to}
case which do
:from_only -> {date_a, nil}
:to_only -> {nil, date_a}
:both -> {date_a, date_b}
end
end
end
defp value_date_gen do
map(integer(-3650..3650), &Date.add(~D[2000-01-01], &1))
end
defp value_date_gen, do: date_gen()
# Property -------------------------------------------------------------