Skip to content

test(datepicker): mock current date

Paul Gascou-Vaillancourt requested to merge datepicker-mock-date into master

The datepicker's story currently shows the datepicker opened by default so we can test it for visual regressions. While this is exactly what we want, it's causing some pipeline failures because all past days are greyed out, and the current day is shown in bold, which means that we would need to update the snapshots every day until we're in February, which is not ideal.

image

To prevent this from happening, this MR introduces a useFakeDate mixin that can be applied to any given story to mock the date in visual tests context, which makes these tests deterministic.

Related to !987 (merged)

Edited by Paul Gascou-Vaillancourt

Merge request reports