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:
+15
-1
@@ -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' },
|
||||
|
||||
Reference in New Issue
Block a user