mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
32 lines
807 B
JavaScript
32 lines
807 B
JavaScript
import QUnit from "qunit";
|
|
import { query } from "discourse/tests/helpers/qunit-helpers";
|
|
|
|
class NotificationsTracking {
|
|
constructor(selector, context) {
|
|
this.context = context;
|
|
if (selector instanceof HTMLElement) {
|
|
this.element = selector;
|
|
} else {
|
|
this.element = query(selector);
|
|
}
|
|
}
|
|
|
|
hasSelectedLevelName(name, message) {
|
|
this.context
|
|
.dom(this.element)
|
|
.hasAttribute("data-level-name", name, message);
|
|
}
|
|
|
|
hasSelectedLevelId(id, message) {
|
|
this.context.dom(this.element).hasAttribute("data-level-id", id, message);
|
|
}
|
|
}
|
|
|
|
export function setupNotificationsTrackingAssertions() {
|
|
QUnit.assert.notificationsTracking = function (
|
|
selector = ".notifications-tracking-trigger"
|
|
) {
|
|
return new NotificationsTracking(selector, this);
|
|
};
|
|
}
|