# test\(updater\): cover the deferred clear of a finished manual run \(\#485\) · lucenx/codexbar-plasma

[View on GitCafe](https://git.cafe/lucenx/codexbar-plasma/commit/08710883e0a349e52266f4f4bb2284a0ef16b7fb)

Repository: [lucenx/codexbar-plasma](https://git.cafe/lucenx/codexbar-plasma)

Visibility: public

Requested revision: 08710883e0a349e52266f4f4bb2284a0ef16b7fb

Requested commit: 08710883e0a349e52266f4f4bb2284a0ef16b7fb

Commit: 08710883e0a349e52266f4f4bb2284a0ef16b7fb

Tree: 65345269d1765a4c454f5cf09d213cde6b1d1e95

Author: Simone

Committer: GitHub

## Message

```
test(updater): cover the deferred clear of a finished manual run (#485)

The applet services General -> Updates requests through the persisted
`widgetUpdateRequest` runtime key. An accepted request is marked
`running:<mode>` and only `onBusyChanged` releases it, because the
controller settles `busy` inside its own completion handling. That
handler had no coverage: the existing tests extracted only
`onStatusRecorded` and `onCheckSucceeded`, and every case set `busy`
false and then called `serviceWidgetUpdateRequest()` by hand, so the
deferred path never ran.

`configGeneral.qml` binds both update buttons and the busy indicator to
that key being empty. Inverting the handler condition therefore leaves
the page with a permanent spinner and both buttons disabled, and nothing
in the suite noticed.

The harness now extracts `onBusyChanged` and attaches it to the fake
controller, so the test runs main.qml's own condition. Each case drains
the event loop after the rising edge first: the marker must survive
while a run is active, so only the falling edge can release it. Without
that drain the assertions also pass against the inverted handler, whose
call queued when `busy` rose still clears the marker.

Also corrects the ownership contract in docs/development.md, which still
described `checkNow()` as the module's only entry point even though
#481 added `runNow(install)`, the `initialAvailableVersion` input, and a
deliberate bypass of the check and auto-install settings. Rewraps an
overlong line in docs/usage.md.

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
```

## Parents

- [9b5f7c686fed8f5e0e5d9b068f48c489ab0942e3](https://git.cafe/lucenx/codexbar-plasma/commit/9b5f7c686fed8f5e0e5d9b068f48c489ab0942e3?format=markdown)

[Source at this commit](https://git.cafe/lucenx/codexbar-plasma/tree/08710883e0a349e52266f4f4bb2284a0ef16b7fb?format=markdown)
