# test\(checks\): make QML source assertions layout-insensitive \(\#317\) · lucenx/codexbar-plasma

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

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

Visibility: public

Requested revision: 1762070c9958ec18ef53baa88ba65c9b86b604d1

Requested commit: 1762070c9958ec18ef53baa88ba65c9b86b604d1

Commit: 1762070c9958ec18ef53baa88ba65c9b86b604d1

Tree: b099bd569a833422d4b9b4b7459640928d7ad67b

Author: Simone

Committer: GitHub

## Message

```
test(checks): make QML source assertions layout-insensitive (#317)

The QML checks assert literal source fragments, so they fail on a pure
reformat while passing on a behavior-breaking edit. `docs/development.md`
records this as the reason `qmlformat` stays out of the suite. Running
`qmlformat` over the tree confirms it: all 1500 executed QML assertions
still pass, and only the source-text checks break.

Three of those fragments turned out to protect behavior that nothing
executed. Each was verified by deleting the behavior and watching the
suite stay green, so each gets a test before its fragment goes:

- A SpinBox value assignment severs its binding, so the History window
  re-installs it on edit. tst_settings_pages now edits the real spin and
  then writes the configuration, which stays red without the re-install.
- main.qml persists the updater's status, error, and check time through
  `Plasmoid.configuration`. test_widget_update_wiring extracts the real
  handler bodies and runs them against a fake configuration.
- A clicked account button assigns its own `checked`, severing the same
  kind of binding. tst_visual_layout clicks a real button and then moves
  the selection elsewhere. The existing long-label test looked like it
  covered this, but stayed green when the re-install was removed.

The remaining 290 membership assertions in test_ui_regressions.sh now
compare through `code_contains`, which normalizes only layout: anonymous
function spacing, statement-terminating semicolons, and line breaks. The
statement sequence, identifiers, and operators still have to match, so a
real edit still fails; verified by flipping `separatorBefore` to false
and watching the check go red. Four shape regexes gained `;?` for the
same reason.

This does not adopt `qmlformat`; see the TODO entry for what still
blocks it.

Documentation impact: records the two measured `qmlformat` blockers in
TODO and updates the development guide's claim about why it stays out.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
```

## Parents

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

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