cylc / cylc-ui

Web app for monitoring and controlling Cylc workflows
https://cylc.github.io
GNU General Public License v3.0
37 stars 27 forks source link

Tests: fix mocking of apollo client #1805

Closed MetRonnie closed 6 months ago

MetRonnie commented 6 months ago

This mocking did not seem to be working, resulting in noisy warnings when running the tests:

stdout | tests/unit/services/workflow.service.spec.js > WorkflowService > startSubscriptions > should start pending subscriptions
Subscription error: Failed to parse URL from /graphql ViewState { enumKey: 'ERROR', enumOrdinal: 2 } TypeError: Failed to parse URL from /graphql
    at node:internal/deps/undici/undici:12502:13 {
  [cause]: TypeError: Invalid URL: /graphql
      at new URLImpl (C:\Users\ronnie.dutta\GitHub\cylc-ui\node_modules\whatwg-url\lib\URL-impl.js:23:13)
      at Object.exports.setup (C:\Users\ronnie.dutta\GitHub\cylc-ui\node_modules\whatwg-url\lib\URL.js:54:12)
      at new URL (C:\Users\ronnie.dutta\GitHub\cylc-ui\node_modules\whatwg-url\lib\URL.js:115:22)
      at new Request (node:internal/deps/undici/undici:4853:25)
      at fetch (node:internal/deps/undici/undici:9662:25)
      at fetch (node:internal/deps/undici/undici:12500:10)
      at value (node:internal/bootstrap/web/exposed-window-or-worker:72:12)
      at C:\Users\ronnie.dutta\GitHub\cylc-ui\node_modules\@apollo\client\link\http\createHttpLink.js:127:13
      at new Subscription (C:\Users\ronnie.dutta\GitHub\cylc-ui\node_modules\zen-observable\lib\Observable.js:197:34)
      at Observable.subscribe (C:\Users\ronnie.dutta\GitHub\cylc-ui\node_modules\zen-observable\lib\Observable.js:279:14)
}

Check List