Füge Unterstützung für die Anzeige mehrerer aktiver Umfragen als Accordion oder Slider hinzu und aktualisiere die Version auf 1.1.0

This commit is contained in:
Torsten Brendgen
2026-08-24 19:38:12 +02:00
parent fcd8e026ee
commit f87c49a91a
16 changed files with 214 additions and 51 deletions
+15 -1
View File
@@ -1,4 +1,10 @@
import { calculatePollResults, findUserAnswer, parsePollOptionLines, selectActivePoll } from '../src/webparts/dynamicPoll/PollCore';
import {
calculatePollResults,
findUserAnswer,
parsePollOptionLines,
selectActivePoll,
selectActivePolls
} from '../src/webparts/dynamicPoll/PollCore';
import { IPoll, IPollAnswer } from '../src/webparts/dynamicPoll/PollTypes';
let passed: number = 0;
@@ -18,6 +24,14 @@ const selected: IPoll = selectActivePoll([
startDate: new Date('2026-08-24T00:00:00Z') })
], now);
assert('current poll is selected by activation window', !!selected && selected.id === 2);
const activePolls: IPoll[] = selectActivePolls([
poll({ id: 2, question: 'newer', options: ['A'], isActive: true,
startDate: new Date('2026-08-23T00:00:00Z') }),
poll({ id: 4, question: 'older', options: ['A'], isActive: true,
startDate: new Date('2026-08-21T00:00:00Z') })
], now);
assert('all active polls are returned in activation order',
activePolls.length === 2 && activePolls[0].id === 2 && activePolls[1].id === 4);
const answers: IPollAnswer[] = [
{ id: 1, userKey: 'one@contoso.local', answer: 'A' },