Skip to content
Snippets Groups Projects
user avatar
Julian Dominguez-Schatz authored
* Add "end" field with date/count options

* Use "end" field to generate schedule

* Show "end" field in recurring description

* Disable weekend before/after picker when not enabled

* Add release notes

* Fix failing typechecks

* Add some description tests

* PR feedback

* 'Features', not 'Feature'

* Fix goal templates infinite loop

* Empty commit to bump ci

* Fix bug where schedule templates in the past would apply incorrectly

For example, if you had a schedule which started in November 2023 for
1.00, and you applied the schedule in October 2023, then you would end
up with a value of 0.50 applied in October.

* Fix handling of schedules with an end date

This commit also includes a refactor of the skip-weekend logic: rather
than referring only to dates with skipped weekends (which requires
checking whether the "next date" request worked correctly), we track a
"base date" which is the previous value of the schedule according to the
rrule, excluding any weekend-skipping. This lets us use `addDays(baseDate, 1)`
to get the next occurrence, regardless of the weekend behaviour.

Doing things this way ensures that the loop will always make progress.

* Only compute skipped weekend if weekend skips were requested

* Fix typo in iterate-schedule-occurrences code

We should be using `nextBaseDate` to derive the next base date, not
`nextDate`; this is because we want the base date to be guaranteed to
make progress in each loop iteration, so we can finish in at most 30
iterations without duplicate base dates.

* Use const

* Revert const -> let for one mutable variable
c09a85f3
History

Actual on the web

E2E tests

E2E (end-to-end) tests use Playwright. Running them requires an Actual server to be running either locally or on a remote server.

Functional

Running against the local server:

# Start the development server
yarn start

# Run against the local server (localhost:3001)
yarn e2e

Running against a remote server:

E2E_START_URL=http://my-remote-server.com yarn e2e

Visual regression

Visual regression tests (also known as screenshot tests) check that the visual appearance of the product has not regressed. Each environment has slightly different colors, fonts etc. Mac differs from Windows which differs from Linux. In order to have a stable test environment for visual comparisons - you must use a standartised docker container. This ensures that the tests are always ran in a consistent environment.

Prerequisites:

  • Docker installed

Running against the local server

First start the dev server:

HTTPS=true yarn start

Next, navigate to the root of your project folder, run the standartised docker container, and launch the visual regression tests from within it.

# Run docker container
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.37.0-jammy /bin/bash

    # If you recieve an error such as "docker: invalid reference format", please instead use the following command:
    docker run --rm --network host -v ${pwd}:/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.37.0-jammy /bin/bash

# Run the VRT tests: important - they MUST be ran against a HTTPS server
E2E_START_URL=https://192.168.0.178:3001 yarn vrt

    # To update snapshots, use the following command:
    E2E_START_URL=https://192.168.0.178:3001 yarn vrt --update-snapshots

Running against a remote server

You can also run the tests against a remote server by passing the URL:

E2E_START_URL=https://my-remote-server.com yarn vrt