mirror of https://github.com/zulip/zulip.git
create stream: Improve click handler for Create.
We want to avoid submit handlers here, because we may have embedded widgets that have their own forms or buttons. We use "finalize" here to distinguish the two Create buttons related to streams. You hit one button to start the UI and then the second button to finalize the process. I also fix the bad test idiom of clicking on the sea-green button.
This commit is contained in:
parent
e8ad76f522
commit
67fe782714
|
@ -175,7 +175,7 @@ async function create_stream(page: Page): Promise<void> {
|
|||
await wait_for_checked(page, "cordelia", true);
|
||||
await wait_for_checked(page, "desdemona", true); // Add desdemona back as we did unset all in last test.
|
||||
await wait_for_checked(page, "othello", false);
|
||||
await page.click("form#stream_creation_form button.button.sea-green");
|
||||
await page.click("form#stream_creation_form .finalize_create_stream");
|
||||
await page.waitForFunction(() => $(".stream-name").is(':contains("Puppeteer")'));
|
||||
const stream_name = await common.get_text_from_selector(
|
||||
page,
|
||||
|
|
|
@ -446,7 +446,7 @@ export function set_up_handlers() {
|
|||
|
||||
container.on("change", "#make-invite-only input", update_announce_stream_state);
|
||||
|
||||
container.on("submit", "#stream_creation_form", (e) => {
|
||||
container.on("click", ".finalize_create_stream", (e) => {
|
||||
e.preventDefault();
|
||||
clear_error_display();
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="button small white rounded" data-dismiss="modal">{{t "Cancel" }}</button>
|
||||
<button class="button small sea-green rounded" type="submit">{{t "Create" }}</button>
|
||||
<button class="finalize_create_stream button small sea-green rounded" type="submit">{{t "Create" }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue