Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: remove qunit rails fork and add a couple of async tests
- Loading branch information
1 parent
0a44297
commit 54d1530
Showing
9 changed files
with
489 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class QunitController < ApplicationController | ||
skip_before_action :check_xhr, :preload_json | ||
layout false | ||
|
||
# only used in test / dev | ||
def index | ||
raise Discourse::InvalidAccess.new if Rails.env.production? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>QUnit Test Runner</title> | ||
<%= stylesheet_link_tag "qunit" %> | ||
<%= stylesheet_link_tag "test_helper" %> | ||
<%= javascript_include_tag "qunit" %> | ||
<%= javascript_include_tag "test_helper" %> | ||
<%= csrf_meta_tags %> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
import { acceptance } from "helpers/qunit-helpers"; | ||
acceptance("User Directory"); | ||
|
||
QUnit.test("Visit Page", assert => { | ||
visit("/users"); | ||
andThen(() => { | ||
assert.ok($('body.users-page').length, "has the body class"); | ||
assert.ok(exists('.directory table tr'), "has a list of users"); | ||
}); | ||
QUnit.test("Visit Page", async assert => { | ||
await visit("/users"); | ||
assert.ok($('body.users-page').length, "has the body class"); | ||
assert.ok(exists('.directory table tr'), "has a list of users"); | ||
}); | ||
|
||
QUnit.test("Visit All Time", assert => { | ||
visit("/users?period=all"); | ||
andThen(() => { | ||
assert.ok(exists('.time-read'), "has time read column"); | ||
}); | ||
}); | ||
QUnit.test("Visit All Time", async assert => { | ||
await visit("/users?period=all"); | ||
assert.ok(exists('.time-read'), "has time read column"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.