Skip to content

Commit

Permalink
chore(lint): fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Nov 28, 2022
1 parent b12cbf1 commit 39bc182
Show file tree
Hide file tree
Showing 45 changed files with 568 additions and 745 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module("Integration | Component | ca-field-select", function (hooks) {
test.skip("it renders", async function (assert) {
assert.expect(1);

await render(hbs`<CaFieldSelect @path="" @onSelect={{this.update}}/>`);
await render(hbs`<CaFieldSelect @path="" @onSelect={{this.update}} />`);

assert.dom(this.element).exists();
});
Expand All @@ -26,7 +26,7 @@ module("Integration | Component | ca-field-select", function (hooks) {
assert.expect(2);

await render(
hbs`<CaFieldSelect @path="" @child={{true}} @onSelect={{this.update}}/>`
hbs`<CaFieldSelect @path="" @child={{true}} @onSelect={{this.update}} />`
);

assert.dom(this.element).exists();
Expand All @@ -38,10 +38,9 @@ module("Integration | Component | ca-field-select", function (hooks) {

// TODO: setup mirage to satisfy *fetchOptions

await render(hbs`<CaFieldSelect
@selectedPath={{this.path}}
@onSelect={{this.update}}
/>`);
await render(
hbs`<CaFieldSelect @selectedPath={{this.path}} @onSelect={{this.update}} />`
);

assert
.dom("[data-test-field-select-primary-selector]")
Expand All @@ -60,10 +59,10 @@ module("Integration | Component | ca-field-select", function (hooks) {
this.set("path", "grandpa.father.son");

await render(hbs`<CaFieldSelect
@selectedPath={{this.path}}
@parentPath=""
@onSelect={{this.update}}
/>`);
@selectedPath={{this.path}}
@parentPath=""
@onSelect={{this.update}}
/>`);

assert
.dom("[data-test-field-select-primary-selector]")
Expand Down Expand Up @@ -96,10 +95,9 @@ module("Integration | Component | ca-field-select", function (hooks) {

this.set("path", "grandpa.father.son");

await render(hbs`<CaFieldSelect
@selectedPath={{this.path}}
@onSelect={{this.update}}
/>`);
await render(
hbs`<CaFieldSelect @selectedPath={{this.path}} @onSelect={{this.update}} />`
);
selectChoose(".ember-power-select-trigger", "father");

assert.verifySteps(["selection"]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ module(
});

await render(
hbs`<CaFieldSelectorList::CaFieldAliasInput @value={{this.alias}} @onInput={{this.onSave}} />`
hbs`<CaFieldSelectorList::CaFieldAliasInput
@value={{this.alias}}
@onInput={{this.onSave}}
/>`
);
assert.dom("[data-test-field-alias-input]").hasValue(this.alias);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ module(
});

await render(
hbs`<CaFieldSelectorList::CaFieldFunctionSelect @update={{this.update}} @field={{this.field}} @tableSlug={{"test"}} />`
hbs`<CaFieldSelectorList::CaFieldFunctionSelect
@update={{this.update}}
@field={{this.field}}
@tableSlug={{"test"}}
/>`
);

const requests = this.server.pretender.handledRequests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ module("Integration | Component | ca-filter-modal", function (hooks) {
assert.dom(this.element).hasText("");

// Template block usage:
await render(hbs`
<CaFilterModal>
template block text
</CaFilterModal>
`);
await render(hbs`{{! template-lint-disable no-bare-strings }}
<CaFilterModal>
template block text
</CaFilterModal>`);

assert.dom(this.element).hasText("template block text");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,19 @@ module("Integration | Component | ca-report-builder", function (hooks) {
});

test("it renders the table from slug", async function (assert) {
await render(hbs`
<CaReportBuilder
@on-add={{this.onAdd}}
@analyticsTable={{this.analyticsTable}}
/>`);
await render(hbs`<CaReportBuilder
@on-add={{this.onAdd}}
@analyticsTable={{this.analyticsTable}}
/>`);

assert.dom("[data-test-analytics-table]").exists();
});

todo("the form for creating new fields works", async function (assert) {
await render(hbs`
<CaReportBuilder
@on-add={{this.onAdd}}
@analyticsTable={{this.analyticsTable}}
/>`);
await render(hbs`<CaReportBuilder
@on-add={{this.onAdd}}
@analyticsTable={{this.analyticsTable}}
/>`);

assert.dom("input[name=alias]").exists({ count: 1 });
// assert.dom("input[name=alias]").("test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module("Integration | Component | ca-report-list", function (hooks) {
this.set("itemRoute", "demo.builder");

await render(
hbs`<CaReportList @reports={{this.reports}} @itemRoute={{this.itemRoute}}/>`
hbs`<CaReportList @reports={{this.reports}} @itemRoute={{this.itemRoute}} />`
);

assert.dom(this.element).containsText("t:caluma.analytics.list.list-title");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ module("Integration | Component | ca-toggle-switch", function (hooks) {

this.set("value", false);

await render(hbs`
<CaToggleSwitch
@name="test"
@value={{this.value}}
@update={{fn (mut this.value)}}
/>
`);
await render(hbs`<CaToggleSwitch
@name="test"
@value={{this.value}}
@update={{fn (mut this.value)}}
/>`);

assert.dom("input[name=test]").isNotChecked();

Expand All @@ -40,13 +38,9 @@ module("Integration | Component | ca-toggle-switch", function (hooks) {
this.set("value", value);
});

await render(hbs`
<CaToggleSwitch
@name="test"
@value={{this.value}}
@update={{this.update}}
/>
`);
await render(
hbs`<CaToggleSwitch @name="test" @value={{this.value}} @update={{this.update}} />`
);

assert.dom("input[name=test]").isNotChecked();

Expand Down
24 changes: 10 additions & 14 deletions packages/core/tests/integration/query-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,16 @@ class QueryComponent extends Component {
}

setComponentTemplate(
hbs`
<button id="toggle" type="button" {{on "click" this.toggle}}>toggle</button>
<ul
{{did-insert this.fetch}}
{{did-update this.fetch this.status}}
>
{{#each this.query.value as |item|}}
<li>{{item.id}}</li>
{{/each}}
</ul>
{{#if this.query.hasNextPage}}
<button id="more" type="button" {{on "click" this.more}}>more</button>
{{/if}}
`,
hbs`{{! template-lint-disable no-bare-strings }}
<button id="toggle" type="button" {{on "click" this.toggle}}>toggle</button>
<ul {{did-insert this.fetch}} {{did-update this.fetch this.status}}>
{{#each this.query.value as |item|}}
<li>{{item.id}}</li>
{{/each}}
</ul>
{{#if this.query.hasNextPage}}
<button id="more" type="button" {{on "click" this.more}}>more</button>
{{/if}}`,
QueryComponent
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<tr
role="checkbox"
data-test-group={{group.identifier}}
aria-checked={{includes group.identifier @selectedGroups}}
{{on "click" (fn this.updateSelectedGroups group.identifier)}}
>
<td class="uk-padding-remove-right">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ module("Integration | Component | cd-document-header", function (hooks) {
test("it renders", async function (assert) {
this.status = "Test";

await render(hbs`
<CdDocumentHeader
@name="Test"
@status={{this.status}}
/>
`);
await render(
hbs`<CdDocumentHeader @name="Test" @status={{this.status}} />`
);

assert.dom("[data-test-document-header]").containsText("Test");
assert.dom("[data-test-document-header] .uk-label").hasText("Test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,12 @@ module("Integration | Component | cd-inquiry-new-form", function (hooks) {
});

test("it renders", async function (assert) {
await render(hbs`
<CdInquiryNewForm
@selectedTypes={{this.selectedTypes}}
@search={{this.search}}
@onChangeSelectedTypes={{fn (mut this.selectedTypes)}}
@onChangeSearch={{fn (mut this.search)}}
/>
`);
await render(hbs`<CdInquiryNewForm
@selectedTypes={{this.selectedTypes}}
@search={{this.search}}
@onChangeSelectedTypes={{fn (mut this.selectedTypes)}}
@onChangeSearch={{fn (mut this.search)}}
/>`);

assert.dom("button[data-test-type]").exists({ count: 2 });
assert.dom("tr[data-test-group]").exists({ count: 2 });
Expand All @@ -92,15 +89,12 @@ module("Integration | Component | cd-inquiry-new-form", function (hooks) {
});

test("it can select and reset groups", async function (assert) {
await render(hbs`
<CdInquiryNewForm
@selectedTypes={{this.selectedTypes}}
@search={{this.search}}
@onChangeSelectedTypes={{fn (mut this.selectedTypes)}}
@onChangeSearch={{fn (mut this.search)}}
/>
`);
await render(hbs`<CdInquiryNewForm
@selectedTypes={{this.selectedTypes}}
@search={{this.search}}
@onChangeSelectedTypes={{fn (mut this.selectedTypes)}}
@onChangeSearch={{fn (mut this.search)}}
/>`);

assert.dom("ul[data-test-selected-groups]").doesNotExist();

Expand All @@ -121,15 +115,12 @@ module("Integration | Component | cd-inquiry-new-form", function (hooks) {
assert.deepEqual(model, { from: "1", to: "2" });
};

await render(hbs`
<CdInquiryNewForm
@selectedTypes={{this.selectedTypes}}
@search={{this.search}}
@onChangeSelectedTypes={{fn (mut this.selectedTypes)}}
@onChangeSearch={{fn (mut this.search)}}
/>
`);
await render(hbs`<CdInquiryNewForm
@selectedTypes={{this.selectedTypes}}
@search={{this.search}}
@onChangeSelectedTypes={{fn (mut this.selectedTypes)}}
@onChangeSearch={{fn (mut this.search)}}
/>`);

await click("tr[data-test-group='2']");
await click("tr[data-test-group='3']");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ module("Integration | Component | cd-navigation/section", function (hooks) {

this.owner.lookup("service:router").isActive = () => true;

await render(hbs`
<CdNavigation::Section @type={{this.type}} />
`);
await render(hbs`<CdNavigation::Section @type={{this.type}} />`);

assert
.dom("li:first-of-type > a")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ module("Integration | Component | cfb-code-editor", function (hooks) {
setupRenderingTest(hooks);

test("it updates value", async function (assert) {
await render(hbs`
<CfbCodeEditor
@name="editor"
@language="jexl"
@update={{fn (mut this.value)}}
@setDirty={{fn (mut this.dirty) true}}
/>
`);
await render(hbs`<CfbCodeEditor
@name="editor"
@language="jexl"
@update={{fn (mut this.value)}}
@setDirty={{fn (mut this.dirty) true}}
/>`);

// use `typeIn` because codejar listens to keydown event
await typeIn("[name=editor]", "1 + 1");
Expand All @@ -32,15 +30,13 @@ module("Integration | Component | cfb-code-editor", function (hooks) {
test("it updates value on change from outside", async function (assert) {
this.value = "true";

await render(hbs`
<CfbCodeEditor
@name="editor"
@value={{this.value}}
@language="jexl"
@update={{fn (mut this.value)}}
@setDirty={{fn (mut this.dirty) true}}
/>
`);
await render(hbs`<CfbCodeEditor
@name="editor"
@value={{this.value}}
@language="jexl"
@update={{fn (mut this.value)}}
@setDirty={{fn (mut this.dirty) true}}
/>`);

assert.dom(this.element).hasText("true");

Expand All @@ -53,15 +49,13 @@ module("Integration | Component | cfb-code-editor", function (hooks) {
test("it updates json data", async function (assert) {
this.value = {};

await render(hbs`
<CfbCodeEditor
@name="editor"
@value={{this.value}}
@language="json"
@update={{fn (mut this.value)}}
@setDirty={{fn (mut this.dirty) true}}
/>
`);
await render(hbs`<CfbCodeEditor
@name="editor"
@value={{this.value}}
@language="json"
@update={{fn (mut this.value)}}
@setDirty={{fn (mut this.dirty) true}}
/>`);

await fillIn("[name=editor]", `{"bar":"baz"}`);
await typeIn("[name=editor]", " ");
Expand Down
Loading

0 comments on commit 39bc182

Please sign in to comment.