mirror of
https://github.com/discourse/discourse.git
synced 2025-06-23 02:41:31 +08:00
DEV: [gjs-codemod] Convert automation/styleguide/other to gjs
Co-authored-by: Jarek Radosz <jarek@cvx.dev>
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import { getOwner } from "@ember/owner";
|
||||
import { fillIn, render } from "@ember/test-helpers";
|
||||
import { hbs } from "ember-cli-htmlbars";
|
||||
import { module, test } from "qunit";
|
||||
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
||||
import AutomationField from "discourse/plugins/automation/admin/components/automation-field";
|
||||
import AutomationFabricators from "discourse/plugins/automation/admin/lib/fabricators";
|
||||
|
||||
module("Integration | Component | da-message-field", function (hooks) {
|
||||
@ -13,12 +13,19 @@ module("Integration | Component | da-message-field", function (hooks) {
|
||||
});
|
||||
|
||||
test("set value", async function (assert) {
|
||||
const self = this;
|
||||
|
||||
this.field = new AutomationFabricators(getOwner(this)).field({
|
||||
component: "message",
|
||||
});
|
||||
|
||||
await render(
|
||||
hbs`<AutomationField @automation={{this.automation}} @field={{this.field}} />`
|
||||
<template>
|
||||
<AutomationField
|
||||
@automation={{self.automation}}
|
||||
@field={{self.field}}
|
||||
/>
|
||||
</template>
|
||||
);
|
||||
await fillIn("textarea", "Hello World");
|
||||
|
||||
@ -26,13 +33,20 @@ module("Integration | Component | da-message-field", function (hooks) {
|
||||
});
|
||||
|
||||
test("render placeholders", async function (assert) {
|
||||
const self = this;
|
||||
|
||||
this.field = new AutomationFabricators(getOwner(this)).field({
|
||||
component: "message",
|
||||
});
|
||||
this.automation.placeholders = ["foo", "bar"];
|
||||
|
||||
await render(
|
||||
hbs`<AutomationField @automation={{this.automation}} @field={{this.field}} />`
|
||||
<template>
|
||||
<AutomationField
|
||||
@automation={{self.automation}}
|
||||
@field={{self.field}}
|
||||
/>
|
||||
</template>
|
||||
);
|
||||
|
||||
assert.dom(".placeholders-list").hasText("foo bar");
|
||||
|
Reference in New Issue
Block a user