This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/unit
Jarek Radosz b78ab82284 DEV: Fix a flaky/leaky test
* pretender wasn't catching the request because it ran after this test finished
* restore wasn't needed, we do `sinon.restore()` after each test

The error was:
```
↪ Unit | Model | user::resolvedTimezone [✔]
↪ Unit | Utility | url::routeTo with prefixUnhandled request in test environment: /forum/u/chuck.json (PUT)
Error: Unhandled request in test environment: /forum/u/chuck.json (PUT)
    at Pretender.server.unhandledRequest (discourse/tests/setup-tests:173:15)
    at Pretender.handleRequest (pretender:400:14)
    at FakeRequest.send (pretender:169:21)
    at Object.send (jquery:10100:10)
    at Function.ajax (jquery:9683:15)
    at performAjax (discourse/app/lib/ajax:174:19)
    at eval (discourse/app/lib/ajax:183:11)
    at invokeCallback (ember:63104:17)
    at publish (ember:63087:9)
    at eval (ember:57463:16)
 [✘]
```

A minimal reproduction:
`http://localhost:3001/qunit?seed=3&testId=da76996b&testId=e52a53e7`
2021-06-22 09:49:09 +08:00
..
controllers UX: Improvements for reordering categories (#13013) 2021-06-09 13:01:06 +03:00
ember DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00
lib FIX: Add word boundaries to replace and tag watched words (#13405) 2021-06-18 18:54:06 +03:00
mixins DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00
models DEV: Fix a flaky/leaky test 2021-06-22 09:49:09 +08:00
services REFACTOR: removes unused code (#13412) 2021-06-18 11:55:49 +02:00
utils DEV: Migrate to Ember CLI (#11932) 2021-02-03 14:22:20 -05:00
localization-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00