Fix unit tests for VacDay[] type migration #142

Merged
admin-backup merged 2 commits from copilot/sub-pr-61-another-one into THoguet/issue16 2025-11-30 03:12:58 +01:00
admin-backup commented 2025-11-30 03:06:33 +01:00 (Migrated from 172.24.0.1:8928)

Unit tests were failing after migrating from VacationsNumber (object with cp, rtt, other properties) to VacDay[] array structure.

Changes

  • user-input.spec.ts: Replaced obsolete userInputForm tests with tests for addDay() and removeFromList() methods
  • user-input-service.spec.ts: Updated tests to validate VacDay[] array structure and properties (id, type, numberOfDays, expiryDate); fixed test suite name

Before/After

// Before - old VacationsNumber type
expect(vacations.cp).toBeGreaterThanOrEqual(1);
expect(vacations.rtt).toBeGreaterThanOrEqual(1);

// After - new VacDay[] structure
expect(Array.isArray(vacations)).toBe(true);
vacations.forEach((day) => {
  expect(day.numberOfDays).toBeGreaterThanOrEqual(1);
  expect(day.expiryDate).toBeInstanceOf(Date);
});

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Unit tests were failing after migrating from `VacationsNumber` (object with `cp`, `rtt`, `other` properties) to `VacDay[]` array structure. ### Changes - **user-input.spec.ts**: Replaced obsolete `userInputForm` tests with tests for `addDay()` and `removeFromList()` methods - **user-input-service.spec.ts**: Updated tests to validate `VacDay[]` array structure and properties (`id`, `type`, `numberOfDays`, `expiryDate`); fixed test suite name ### Before/After ```typescript // Before - old VacationsNumber type expect(vacations.cp).toBeGreaterThanOrEqual(1); expect(vacations.rtt).toBeGreaterThanOrEqual(1); // After - new VacDay[] structure expect(Array.isArray(vacations)).toBe(true); vacations.forEach((day) => { expect(day.numberOfDays).toBeGreaterThanOrEqual(1); expect(day.expiryDate).toBeInstanceOf(Date); }); ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
admin-backup commented 2025-11-30 03:06:33 +01:00 (Migrated from 172.24.0.1:8928)

assigned to @Copilot

assigned to `@Copilot`
admin-backup commented 2025-11-30 03:06:33 +01:00 (Migrated from 172.24.0.1:8928)

assigned to @THoguet

assigned to `@THoguet`
admin-backup commented 2025-11-30 03:06:36 +01:00 (Migrated from 172.24.0.1:8928)

mentioned in merge request !61

mentioned in merge request [!61](https://gitea.nessar.fr/nessar/vac-optimizer/pulls/139)
admin-backup commented 2025-11-30 03:12:23 +01:00 (Migrated from 172.24.0.1:8928)

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
  • clientservices.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
  • safebrowsingohttpgateway.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. > [!WARNING] > > <details> > <summary>Firewall rules blocked me from connecting to one or more addresses (expand for details)</summary> > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `accounts.google.com` > - Triggering command: `/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041` (dns block) > - Triggering command: `/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222` (dns block) > - `clients2.google.com` > - Triggering command: `/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041` (dns block) > - Triggering command: `/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222` (dns block) > - `clientservices.googleapis.com` > - Triggering command: `/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041` (dns block) > - Triggering command: `/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222` (dns block) > - `redirector.gvt1.com` > - Triggering command: `/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041` (dns block) > - Triggering command: `/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222` (dns block) > - `safebrowsingohttpgateway.googleapis.com` > - Triggering command: `/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041` (dns block) > - Triggering command: `/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222` (dns block) > - `www.google.com` > - Triggering command: `/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3626 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-4634782 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4115905472836938781,18327784655836221968,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041` (dns block) > - Triggering command: `/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-4634782 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=4634782 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222` (dns block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/THoguet/vac-optimizer/settings/copilot/coding_agent) (admins only) > > </details>
admin-backup commented 2025-11-30 03:12:24 +01:00 (Migrated from 172.24.0.1:8928)

changed title from {-[WIP] Refact-}or {-v-}ac{-ation management system with day tracking-} to {+Fix unit tests f+}or {+V+}ac{+Day[] type migration+}

changed title from **{-[WIP] Refact-}or {-v-}ac{-ation management system with day tracking-}** to **{+Fix unit tests f+}or {+V+}ac{+Day[] type migration+}**
admin-backup commented 2025-11-30 03:12:36 +01:00 (Migrated from 172.24.0.1:8928)

requested review from @THoguet

requested review from `@THoguet`
admin-backup commented 2025-11-30 03:12:58 +01:00 (Migrated from 172.24.0.1:8928)

Merged by: THoguet at 2025-11-30 02:12:58 UTC

*Merged by: THoguet at 2025-11-30 02:12:58 UTC*
admin-backup (Migrated from 172.24.0.1:8928) closed this pull request 2025-11-30 03:12:58 +01:00
admin-backup (Migrated from 172.24.0.1:8928) merged commit into THoguet/issue16 2025-11-30 03:12:58 +01:00

Preserved source assignment/reviewer metadata. Historical accounts stay inactive.

Source requested reviewers: admin-backup (GitLab user 3).

The linked history record retains original IDs and source dates. No historical identity was merged into nessar or granted new authentication permissions.

<!-- gitlab-to-gitea-assignment:35:MergeRequest:64 --> Preserved source assignment/reviewer metadata. Historical accounts stay inactive. Source requested reviewers: admin-backup (GitLab user 3). The linked history record retains original IDs and source dates. No historical identity was merged into nessar or granted new authentication permissions.

Preserved GitLab !64 history: source attribution, exact timestamps, discussion grouping and review positions. Historical diff snapshots: 1; visible source notes: 7.

gitlab-35-mergerequest-64.md (SHA-256 65e5ed257c91b77970b8b9cc94c01def1c192205b5b7e1a9555018bf775e6f07)

gitlab-35-mergerequest-64.json (SHA-256 a0703ecb7e8d45d162f7720cc347815554f49f40580c1786a7586d52381d67a8)

Old CI job execution and reports are omitted. Original source files and rollback backups remain protected.

<!-- gitlab-to-gitea-history:35:MergeRequest:64 --> Preserved GitLab !64 history: source attribution, exact timestamps, discussion grouping and review positions. Historical diff snapshots: 1; visible source notes: 7. [gitlab-35-mergerequest-64.md](https://gitea.nessar.fr/attachments/05711fd3-2830-40bf-9fec-729861aa3ba7) (SHA-256 `65e5ed257c91b77970b8b9cc94c01def1c192205b5b7e1a9555018bf775e6f07`) [gitlab-35-mergerequest-64.json](https://gitea.nessar.fr/attachments/d50b6d63-d578-4fe4-afdf-ace51fa0cc49) (SHA-256 `a0703ecb7e8d45d162f7720cc347815554f49f40580c1786a7586d52381d67a8`) Old CI job execution and reports are omitted. Original source files and rollback backups remain protected.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/vac-optimizer#142