Skip to content

Commit

Permalink
test(cfb-form-editor/general): assert translated strings
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabauke authored and anehx committed Feb 16, 2024
1 parent 8d5cbb6 commit 3b8df3a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, click, fillIn, blur } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
import { setupMirage } from "ember-cli-mirage/test-support";
import { setupIntl } from "ember-intl/test-support";
import { setupIntl, t } from "ember-intl/test-support";
import { module, test } from "qunit";

import { setupRenderingTest } from "dummy/tests/helpers";
Expand All @@ -10,7 +10,7 @@ import graphqlError from "dummy/tests/helpers/graphql-error";
module("Integration | Component | cfb-form-editor/general", function (hooks) {
setupRenderingTest(hooks);
setupMirage(hooks);
setupIntl(hooks);
setupIntl(hooks, "en");

test("it renders", async function (assert) {
assert.expect(4);
Expand Down Expand Up @@ -181,7 +181,7 @@ module("Integration | Component | cfb-form-editor/general", function (hooks) {

assert
.dom("p")
.hasText('t:caluma.form-builder.form.not-found:("slug":"test-slug")');
.hasText(t("caluma.form-builder.form.not-found", { slug: "test-slug" }));
});

test("it validates the slug", async function (assert) {
Expand All @@ -197,7 +197,7 @@ module("Integration | Component | cfb-form-editor/general", function (hooks) {

assert
.dom("small.uk-text-danger")
.hasText("t:caluma.form-builder.validations.form.slug:()");
.hasText(t("caluma.form-builder.validations.form.slug"));

await fillIn("input[name=slug]", "valid-slug");

Expand All @@ -207,6 +207,6 @@ module("Integration | Component | cfb-form-editor/general", function (hooks) {

assert
.dom("small.uk-text-danger")
.hasText("t:caluma.form-builder.validations.form.slug:()");
.hasText(t("caluma.form-builder.validations.form.slug"));
});
});

0 comments on commit 3b8df3a

Please sign in to comment.