Plugin 1.2.0: Taste 'Gefaellt mir nicht', Fortschrittsbalken auf 'Aktueller Titel'

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-15 11:04:26 +01:00
co-authored by Claude Opus 5.5
parent b8b709c986
commit 00047b9fa1
16 changed files with 170 additions and 23 deletions
+28
View File
@@ -248,3 +248,31 @@ test('willDisappear raeumt Taste und Wiederholung auf', () => {
assert.equal(controller.keys.size, 0);
assert.equal(controller.repeaters.size, 0);
});
test('Aktueller Titel zeigt Fortschritt ueber dem Cover, abschaltbar', async () => {
const { host, client, controller } = setup();
client.state = { ...STATE, tabs: { ...STATE.tabs, music: { ...STATE.tabs.music, currentTime: 30, duration: 120 } } };
appear(controller, 'nowplaying', 'np');
await controller.poll();
await tick(20);
const image = host.named('setImage').filter((c) => c[1] === 'np').at(-1)[2];
assert.match(image, /^data:image\/svg\+xml;base64,/);
const svg = Buffer.from(image.split(',')[1], 'base64').toString('utf8');
assert.match(svg, /width="36\.0" height="7"/, '25 % von 144 px');
appear(controller, 'nowplaying', 'np2', { showProgress: false });
await controller.poll();
await tick(20);
assert.match(host.named('setImage').filter((c) => c[1] === 'np2').at(-1)[2], /^data:image\/jpeg;base64,/);
});
test('Gefaellt-mir-nicht-Taste sendet dislike und zeigt den Zustand', async () => {
const { host, client, controller } = setup();
client.state = { ...STATE, tabs: { ...STATE.tabs, music: { ...STATE.tabs.music, likeStatus: 'dislike' } } };
appear(controller, 'dislike', 'd1');
await controller.poll();
assert.deepEqual(host.named('setState').filter((c) => c[1] === 'd1').at(-1), ['setState', 'd1', 1]);
controller.handleEvent({ event: 'keyUp', context: 'd1' });
await tick();
assert.deepEqual(client.requests.at(-1), { cmd: 'dislike', target: 'auto' });
});