Files
AtreidesAssetsFree/tests/ui/instellingen-gloed.test.mjs
T

40 lines
1.7 KiB
JavaScript
Raw Normal View History

2026-10-29 11:57:29 +01:00
// Generated, do not edit. sha256:c99f1dcd61aab43d76698a5a706d042e6be9c41ba3337187a7c2f0efa590c086
import { describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { glowChoice, glowPatch } from '../../client/pages/settings.js';
describe('glowChoice', () => {
it('toont in Glas de beweging als keuze', () => {
assert.equal(glowChoice({ profile: 'glass', glow: 'on', motion: 'step' }), 'step');
assert.equal(glowChoice({ profile: 'glass', glow: 'on', motion: 'always' }), 'always');
assert.equal(glowChoice({ profile: 'glass', glow: 'on', motion: 'off' }), 'still');
});
it('toont Uit als de gloed uit staat, wat de beweging ook is', () => {
assert.equal(glowChoice({ profile: 'glass', glow: 'off', motion: 'always' }), 'off');
assert.equal(glowChoice({ profile: 'business', glow: 'off' }), 'off');
});
it('kent in Zakelijk alleen aan en uit', () => {
assert.equal(glowChoice({ profile: 'business', glow: 'on', motion: 'always' }), 'on');
});
});
describe('glowPatch', () => {
it('zet in Glas gloed en beweging samen', () => {
assert.deepEqual(glowPatch('glass', 'still'), { glow: 'on', motion: 'off' });
assert.deepEqual(glowPatch('glass', 'always'), { glow: 'on', motion: 'always' });
assert.deepEqual(glowPatch('glass', 'off'), { glow: 'off' });
});
it('schrijft in Zakelijk nooit een beweging', () => {
assert.deepEqual(glowPatch('business', 'on'), { glow: 'on' });
assert.equal(glowPatch('business', 'always'), null);
});
it('is omkeerbaar: de patch van een keuze toont weer die keuze', () => {
for (const keuze of ['off', 'still', 'step', 'always']) {
assert.equal(glowChoice({ profile: 'glass', motion: 'step', ...glowPatch('glass', keuze) }), keuze, keuze);
}
});
});