This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/acceptance/mobile-discovery-test.js
2021-11-08 10:26:28 +01:00

26 lines
754 B
JavaScript

import {
acceptance,
exists,
queryAll,
} from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit";
import { visit } from "@ember/test-helpers";
acceptance("Topic Discovery - Mobile", function (needs) {
needs.mobileView();
test("Visit Discovery Pages", async function (assert) {
await visit("/");
assert.ok(exists(".topic-list"), "The list of topics was rendered");
assert.ok(exists(".topic-list .topic-list-item"), "has topics");
assert.strictEqual(
queryAll("a[data-user-card=codinghorror] img.avatar").attr("loading"),
"lazy",
"it adds loading=`lazy` to topic list avatars"
);
await visit("/categories");
assert.ok(exists(".category"), "has a list of categories");
});
});