mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
Revert "Rename all test files from JS -> ES6"
This reverts commit 2abe85b8344de1102c1589a9ac9421a8b296f2b5.
This commit is contained in:
@ -1,64 +0,0 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import pretender from "helpers/create-pretender";
|
||||
|
||||
acceptance("Keyboard Shortcuts", { loggedIn: true });
|
||||
|
||||
test("go to first suggested topic", async assert => {
|
||||
pretender.get("/t/27331/4.json", () => [
|
||||
200,
|
||||
{ "Content-Type": "application/json" },
|
||||
{}
|
||||
]);
|
||||
|
||||
pretender.get("/t/27331.json", () => [
|
||||
200,
|
||||
{ "Content-Type": "application/json" },
|
||||
{}
|
||||
]);
|
||||
|
||||
/*
|
||||
* No suggested topics exist.
|
||||
*/
|
||||
|
||||
pretender.get("/t/9/last.json", () => [
|
||||
200,
|
||||
{ "Content-Type": "application/json" },
|
||||
{}
|
||||
]);
|
||||
|
||||
await visit("/t/this-is-a-test-topic/9");
|
||||
await keyEvent(document, "keypress", "g".charCodeAt(0));
|
||||
await keyEvent(document, "keypress", "s".charCodeAt(0));
|
||||
assert.equal(currentURL(), "/t/this-is-a-test-topic/9");
|
||||
|
||||
/*
|
||||
* Suggested topics elements exist.
|
||||
*/
|
||||
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await keyEvent(document, "keypress", "g".charCodeAt(0));
|
||||
await keyEvent(document, "keypress", "s".charCodeAt(0));
|
||||
assert.equal(currentURL(), "/t/polls-are-still-very-buggy/27331/4");
|
||||
|
||||
/*
|
||||
* Suggested topic is returned by server.
|
||||
*/
|
||||
|
||||
pretender.get("/t/28830/last.json", () => [
|
||||
200,
|
||||
{ "Content-Type": "application/json" },
|
||||
{
|
||||
suggested_topics: [
|
||||
{
|
||||
id: 27331,
|
||||
slug: "keyboard-shortcuts-are-awesome"
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
await visit("/t/1-3-0beta9-no-rate-limit-popups/28830");
|
||||
await keyEvent(document, "keypress", "g".charCodeAt(0));
|
||||
await keyEvent(document, "keypress", "s".charCodeAt(0));
|
||||
assert.equal(currentURL(), "/t/keyboard-shortcuts-are-awesome/27331");
|
||||
});
|
Reference in New Issue
Block a user