trmnlp-test 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -8
- data/exe/trmnlp-test +1 -1
- data/lib/trmnlp_test/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f44bc072151b6ff26853ba75705a03fca24f33aca527d952041b5810a29f270f
|
|
4
|
+
data.tar.gz: 289b311c101bee94d1074ef800e94fca2cad7106b7a23a321a3731a79fdc2a57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ecd4fc52df5848ccd86db9f2d04939fdfc1d92da65265a90186a1655c99cb1c1f3887cc6e09920dcef8c9d2f57985f83920873caab488a8a59a90b512c0c2983
|
|
7
|
+
data.tar.gz: 19bede68a387575e0ddde38002d32c7a76e13c92d4fc8c9b8aaaa1d6e7e930872a7d4d6f3f1b4fed10776bc3c8ddc88e055bb5e881c73907771d6fe85f32fe48
|
data/README.md
CHANGED
|
@@ -73,7 +73,7 @@ test('menu', async ({ trmnl }) => {
|
|
|
73
73
|
device: 'og_plus', view: 'full', // any model, orientation: 'portrait', palette, theme, scale, textScale, fonts, framework
|
|
74
74
|
darkMode: true, // as the server does it: everything inverted except images ('framework': the v3 class only)
|
|
75
75
|
qr: 'server', // qr_code as TRMNL's server returns it (default); 'trmnlp', 'fixed'
|
|
76
|
-
crlf: true, // the template with CR LF newlines
|
|
76
|
+
crlf: true, // the template with CR LF newlines (e.g. pasted markup)
|
|
77
77
|
fields: { data_source: 'webhook' }, // custom field values (defaults + .trmnlp.yml + these)
|
|
78
78
|
webhook: { merge_variables: {...} }, // or data: {...} to render given data as is
|
|
79
79
|
mocks: { 'https://api.example.com/*': { temp: 21 } },
|
|
@@ -85,7 +85,7 @@ test('menu', async ({ trmnl }) => {
|
|
|
85
85
|
await expect(screen).toHaveNoOverflow();
|
|
86
86
|
await expect(screen).toHaveNoOverlap('.title', 'img');
|
|
87
87
|
await expect(screen).toShowText('Espresso'); // visible: not cut off by an ellipsis, clamp or the edge ({ visible: false }: content only)
|
|
88
|
-
await expect(screen).toHaveQr('BCD\n002...');
|
|
88
|
+
await expect(screen).toHaveQr('BCD\n002...'); // black on white; { inverted: true | 'any' } for dark codes
|
|
89
89
|
await expect(screen).toMatchScreen(); // PNG snapshot (--update-snapshots)
|
|
90
90
|
await expect(screen).toFitDeviceImageLimit();
|
|
91
91
|
const png = await screen.png(); // pixel(x,y), colors(), inkRatio(rect), inkBounds(), crop()
|
|
@@ -110,12 +110,6 @@ for (const s of matrix({ device: DEVICES.representative, view: VIEWS, darkMode:
|
|
|
110
110
|
}
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
**Where TRMNL differs from trmnlp.** trmnlp-test renders with trmnlp's code, except where TRMNL is known to differ (observed on trmnl.com, 2026-10-02):
|
|
114
|
-
|
|
115
|
-
- `qr_code`: the server ignores the view argument and returns the viewBox plus the code's natural width/height and `style="max-width:100%;height:auto"`, so a code only shrinks, never grows (a 25-module code stays 275 px in a bigger box), and a second width added by the template makes the SVG invalid XML inside an `<img>`. This is the default; `qr: 'trmnlp'` renders trmnlp's scalable SVG, `qr: 'fixed'` one without a viewBox (not observed, for robustness). `matrix({ qr: QR_MODES })` covers all three.
|
|
116
|
-
- Dark mode: `darkMode: true` inverts the whole screen except images, as TRMNL describes it and the server preview showed for an inline SVG on framework 3.4. Not yet confirmed on a device for v3. `darkMode: 'framework'` renders the v3 class only, which leaves inline SVG and hard-coded colours as they are.
|
|
117
|
-
- `crlf: true` (not the server: TRMNL's web editor preview) turns the template's newlines into CR LF, so a newline typed in the template no longer matches `\n` in data.
|
|
118
|
-
|
|
119
113
|
Other helpers: `trmnl.plugin('other/dir')`, `trmnl.lint()` with `toPassLint({ allow })`, `FRAMEWORK.majors()`, `FRAMEWORK.latestOf('2')`.
|
|
120
114
|
|
|
121
115
|
## How it works
|
|
@@ -125,4 +119,5 @@ See [docs/README.md](docs/README.md) for diagrams of the components, a render, s
|
|
|
125
119
|
## Examples and self-tests
|
|
126
120
|
|
|
127
121
|
- `examples/payment-qr`: the earlier webhook + serverless version of the payment QR plugin (the current version tests itself with trmnlp-test in its own repository).
|
|
122
|
+
- `test/self/trmnlp-vs-trmnl.spec.js`: where trmnlp renders differently from TRMNL, as tests that fail on trmnlp's behaviour (marked `test.fail`, so they turn red once trmnlp matches). `TRMNLP_TEST_SHOW_DIFFERENCES=1` prints the failures.
|
|
128
123
|
- `test/self`: fixture plugins for every strategy and language (86 tests). Run with `bin/trmnlp-test run --root test/self`.
|
data/exe/trmnlp-test
CHANGED
|
@@ -59,6 +59,6 @@ if args.first == 'shell'
|
|
|
59
59
|
entry = ['--entrypoint', 'bash']
|
|
60
60
|
end
|
|
61
61
|
tty = $stdout.tty? ? ['-t'] : []
|
|
62
|
-
env = %w[CI TRMNLP_TEST_DEBUG TRMNLP_TEST_WORKERS FORCE_COLOR].flat_map { |k| ['-e', k] }
|
|
62
|
+
env = %w[CI TRMNLP_TEST_DEBUG TRMNLP_TEST_WORKERS TRMNLP_TEST_SHOW_DIFFERENCES FORCE_COLOR].flat_map { |k| ['-e', k] }
|
|
63
63
|
exec 'docker', 'run', '--rm', '-i', *tty, '--init', '--ipc=host', '-u', "#{Process.uid}:#{Process.gid}",
|
|
64
64
|
'-v', "#{repo}:#{repo}", '-w', repo, '-v', "#{cache}:/cache", *mounts, *env, *entry, image, *args
|
data/lib/trmnlp_test/version.rb
CHANGED