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' },
|
||||
|
||||
@@ -15,7 +15,7 @@ var service = read('src/webparts/dynamicPoll/PollDataService.ts');
|
||||
var component = read('src/webparts/dynamicPoll/components/DynamicPoll.tsx');
|
||||
var styles = read('src/webparts/dynamicPoll/components/DynamicPoll.module.scss');
|
||||
|
||||
assert(packageJson.version === '1.0.0' && solution.version === '1.0.0.0', 'Version mismatch.');
|
||||
assert(packageJson.version === '1.1.0' && solution.version === '1.1.0.0', 'Version mismatch.');
|
||||
assert(solution.includeClientSideAssets === true && solution.skipFeatureDeployment === true, 'Central deployment missing.');
|
||||
assert(packageJson.name === 'dynamic-poll-web-part' && solution.name === 'dynamic-poll-web-part' &&
|
||||
solution.title === 'dynamic-poll-web-part', 'Dynamic Poll package naming is inconsistent.');
|
||||
@@ -24,6 +24,10 @@ assert(json('config/package-solution.json').paths.zippedPackage === 'solution/dy
|
||||
assert(manifest.componentType === 'WebPart', 'Component is not a web part.');
|
||||
assert(webPart.indexOf("PropertyPaneDropdown('pollListId'") >= 0 && webPart.indexOf("PropertyPaneDropdown('answerListId'") >= 0,
|
||||
'List selection is missing.');
|
||||
assert(webPart.indexOf("PropertyPaneDropdown('displayMode'") >= 0 &&
|
||||
webPart.indexOf('DynamicPollCollection') >= 0, 'Multiple-poll display mode is missing.');
|
||||
assert(service.indexOf('getSnapshots') >= 0 && service.indexOf('getActivePolls') >= 0,
|
||||
'All active polls must be loaded and remain voteable.');
|
||||
assert(service.indexOf("'PollId': pollId") >= 0 && service.indexOf("'Answer': answer") >= 0, 'Vote persistence is missing.');
|
||||
assert(service.indexOf("new Error('ALREADY_VOTED')") >= 0, 'Duplicate vote protection is missing.');
|
||||
assert(service.indexOf("new Error('POLL_NOT_ACTIVE')") >= 0, 'Active poll and answer validation is missing.');
|
||||
|
||||
Reference in New Issue
Block a user