mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Updating the category was not updating the UI
This commit is contained in:
17
test/javascripts/acceptance/topic-anonymous-test.js.es6
Normal file
17
test/javascripts/acceptance/topic-anonymous-test.js.es6
Normal file
@@ -0,0 +1,17 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
acceptance("Topic - Anonymous");
|
||||
|
||||
test("Enter a Topic", () => {
|
||||
visit("/t/internationalization-localization/280/1");
|
||||
andThen(() => {
|
||||
ok(exists("#topic"), "The topic was rendered");
|
||||
ok(exists("#topic .cooked"), "The topic has cooked posts");
|
||||
});
|
||||
});
|
||||
|
||||
test("Enter without an id", () => {
|
||||
visit("/t/internationalization-localization");
|
||||
andThen(() => {
|
||||
ok(exists("#topic"), "The topic was rendered");
|
||||
});
|
||||
});
|
||||
@@ -1,17 +1,33 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
acceptance("View Topic");
|
||||
acceptance("Topic", { loggedIn: true });
|
||||
|
||||
test("Showing and hiding the edit controls", () => {
|
||||
visit("/t/internationalization-localization/280");
|
||||
|
||||
click('#topic-title .fa-pencil');
|
||||
|
||||
test("Enter a Topic", () => {
|
||||
visit("/t/internationalization-localization/280/1");
|
||||
andThen(() => {
|
||||
ok(exists("#topic"), "The topic was rendered");
|
||||
ok(exists("#topic .cooked"), "The topic has cooked posts");
|
||||
ok(exists('#edit-title'), 'it shows the editing controls');
|
||||
});
|
||||
|
||||
fillIn('#edit-title', 'this is the new title');
|
||||
click('#topic-title .cancel-edit');
|
||||
andThen(() => {
|
||||
ok(!exists('#edit-title'), 'it hides the editing controls');
|
||||
});
|
||||
});
|
||||
|
||||
test("Enter without an id", () => {
|
||||
visit("/t/internationalization-localization");
|
||||
test("Updating the topic title and category", () => {
|
||||
visit("/t/internationalization-localization/280");
|
||||
click('#topic-title .fa-pencil');
|
||||
|
||||
fillIn('#edit-title', 'this is the new title');
|
||||
selectDropdown('.category-combobox', 4);
|
||||
|
||||
click('#topic-title .submit-edit');
|
||||
|
||||
andThen(() => {
|
||||
ok(exists("#topic"), "The topic was rendered");
|
||||
equal(find('#topic-title .badge-category').text(), 'faq', 'it displays the new category');
|
||||
equal(find('.fancy-title').text().trim(), 'this is the new title', 'it displays the new title');
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -28,6 +28,12 @@ function visible(selector) {
|
||||
return find(selector + ":visible").length > 0;
|
||||
}
|
||||
|
||||
Ember.Test.registerAsyncHelper('selectDropdown', function(app, selector, itemId) {
|
||||
var $select2 = find(selector);
|
||||
$select2.select2('val', itemId.toString());
|
||||
$select2.trigger("change");
|
||||
});
|
||||
|
||||
function invisible(selector) {
|
||||
var $items = find(selector + ":visible");
|
||||
return $items.length === 0 ||
|
||||
|
||||
Reference in New Issue
Block a user