discourse/plugins/poll/test/javascripts/component
Robert 47f749744f
FIX: poll when config is on_close only show results when poll is closed (#28299)
See: https://meta.discourse.org/t/cant-edit-topic-with-poll-bug-occurs/320845?u=merefield

When the Poll is set to "results ON_CLOSE", vote numbers for each option are only streamed to the browser when the vote is Closed. It is therefore not possible to render the Results.

The current issue is that when you refresh the page, for those that have voted the default view is results. For this type of poll this should NOT happen. The Results view in this mode should not be possible to see until closure, even for the Author.

Because the votes are not yet serialised when this kind of poll remains open, an attempt to display results causes a JavaScript exception and in any case does not make logical sense.

So the fix here is making sure the default view, for Polls that have results on close, is the voting view until the Poll is Closed.

I've added a test to cover this scenario.

Additionally, this requires a refresh of the page when the poll admin actions a Close to ensure the results are serialized in.
2024-08-13 09:29:16 +02:00
..
poll-buttons-dropdown-test.js FEATURE: Absolute Numbers in Poll (#28240) 2024-08-07 11:46:29 +02:00
poll-info-test.js DEV: Clean up imports (#28060) 2024-07-25 15:09:06 +02:00
poll-options-test.js FEATURE: Add Ranked Choice Voting 2024-07-17 11:49:14 +02:00
poll-results-pie-test.js DEV: Check for poll element presence (#27765) 2024-07-08 13:58:35 +02:00
poll-results-ranked-choice-test.js DEV: Clean up imports (#28060) 2024-07-25 15:09:06 +02:00
poll-results-standard-test.js FEATURE: Absolute Numbers in Poll (#28240) 2024-08-07 11:46:29 +02:00
poll-results-tabs-test.js FEATURE: Add Ranked Choice Voting 2024-07-17 11:49:14 +02:00
poll-test.js FIX: poll when config is on_close only show results when poll is closed (#28299) 2024-08-13 09:29:16 +02:00
poll-ui-builder-test.js FEATURE: Configure poll 'public' default via site setting (#24348) 2023-11-13 18:54:21 +00:00