mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 11:28:18 +00:00
* `@ember/owner` instead of `@ember/application` * `discourse-i18n` instead of `I18n` * `{ service } from "@ember/service"` instead of `inject as service`
26 lines
822 B
JavaScript
26 lines
822 B
JavaScript
import { getOwner } from "@ember/owner";
|
|
import { setupTest } from "ember-qunit";
|
|
import { module, test } from "qunit";
|
|
|
|
module("Discourse Chat | Unit | Service | chat-drawer-size", function (hooks) {
|
|
setupTest(hooks);
|
|
|
|
hooks.beforeEach(function () {
|
|
this.subject = getOwner(this).lookup("service:chat-drawer-size");
|
|
});
|
|
|
|
test("get size (with default)", async function (assert) {
|
|
assert.deepEqual(this.subject.size, { width: 400, height: 530 });
|
|
});
|
|
|
|
test("set size", async function (assert) {
|
|
this.subject.size = { width: 400, height: 500 };
|
|
assert.deepEqual(this.subject.size, { width: 400, height: 500 });
|
|
});
|
|
|
|
test("min size", async function (assert) {
|
|
this.subject.size = { width: 100, height: 100 };
|
|
assert.deepEqual(this.subject.size, { width: 250, height: 300 });
|
|
});
|
|
});
|