mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Migrate away from #discourse-modal to .d-modal
This commit is contained in:
@@ -11,12 +11,12 @@ QUnit.test("Can open the category modal", assert => {
|
||||
|
||||
click('.edit-category');
|
||||
andThen(() => {
|
||||
assert.ok(visible('#discourse-modal'), 'it pops up a modal');
|
||||
assert.ok(visible('.d-modal'), 'it pops up a modal');
|
||||
});
|
||||
|
||||
click('a.close');
|
||||
andThen(() => {
|
||||
assert.ok(!visible('#discourse-modal'), 'it closes the modal');
|
||||
assert.ok(!visible('.d-modal'), 'it closes the modal');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@ QUnit.test("Change the category color", assert => {
|
||||
fillIn('#edit-text-color', '#ff0000');
|
||||
click('#save-category');
|
||||
andThen(() => {
|
||||
assert.ok(!visible('#discourse-modal'), 'it closes the modal');
|
||||
assert.ok(!visible('.d-modal'), 'it closes the modal');
|
||||
assert.equal(DiscourseURL.redirectedTo, '/c/bug', 'it does one of the rare full page redirects');
|
||||
});
|
||||
});
|
||||
@@ -40,7 +40,7 @@ QUnit.test("Change the topic template", assert => {
|
||||
fillIn('.d-editor-input', 'this is the new topic template');
|
||||
click('#save-category');
|
||||
andThen(() => {
|
||||
assert.ok(!visible('#discourse-modal'), 'it closes the modal');
|
||||
assert.ok(!visible('.d-modal'), 'it closes the modal');
|
||||
assert.equal(DiscourseURL.redirectedTo, '/c/bug', 'it does one of the rare full page redirects');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -115,13 +115,13 @@ QUnit.test("Create an enqueued Topic", assert => {
|
||||
fillIn('.d-editor-input', "enqueue this content please");
|
||||
click('#reply-control button.create');
|
||||
andThen(() => {
|
||||
assert.ok(visible('#discourse-modal'), 'it pops up a modal');
|
||||
assert.ok(visible('.d-modal'), 'it pops up a modal');
|
||||
assert.equal(currentURL(), "/", "it doesn't change routes");
|
||||
});
|
||||
|
||||
click('.modal-footer button');
|
||||
andThen(() => {
|
||||
assert.ok(invisible('#discourse-modal'), 'the modal can be dismissed');
|
||||
assert.ok(invisible('.d-modal'), 'the modal can be dismissed');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -183,12 +183,12 @@ QUnit.test("Create an enqueued Reply", assert => {
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(visible('#discourse-modal'), 'it pops up a modal');
|
||||
assert.ok(visible('.d-modal'), 'it pops up a modal');
|
||||
});
|
||||
|
||||
click('.modal-footer button');
|
||||
andThen(() => {
|
||||
assert.ok(invisible('#discourse-modal'), 'the modal can be dismissed');
|
||||
assert.ok(invisible('.d-modal'), 'the modal can be dismissed');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -5,26 +5,26 @@ QUnit.test("modal", assert => {
|
||||
visit('/');
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(find('#discourse-modal:visible').length === 0, 'there is no modal at first');
|
||||
assert.ok(find('.d-modal:visible').length === 0, 'there is no modal at first');
|
||||
});
|
||||
|
||||
click('.login-button');
|
||||
andThen(() => {
|
||||
assert.ok(find('#discourse-modal:visible').length === 1, 'modal should appear');
|
||||
assert.ok(find('.d-modal:visible').length === 1, 'modal should appear');
|
||||
});
|
||||
|
||||
click('.modal-outer-container');
|
||||
andThen(() => {
|
||||
assert.ok(find('#discourse-modal:visible').length === 0, 'modal should disappear when you click outside');
|
||||
assert.ok(find('.d-modal:visible').length === 0, 'modal should disappear when you click outside');
|
||||
});
|
||||
|
||||
click('.login-button');
|
||||
andThen(() => {
|
||||
assert.ok(find('#discourse-modal:visible').length === 1, 'modal should reappear');
|
||||
assert.ok(find('.d-modal:visible').length === 1, 'modal should reappear');
|
||||
});
|
||||
|
||||
keyEvent('#main-outlet', 'keydown', 27);
|
||||
andThen(() => {
|
||||
assert.ok(find('#discourse-modal:visible').length === 0, 'ESC should close the modal');
|
||||
assert.ok(find('.d-modal:visible').length === 0, 'ESC should close the modal');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user