@@ -13,3 +16,4 @@
{{/if}}
+)
\ No newline at end of file
diff --git a/app/templates/events.gjs b/app/templates/events.gjs
new file mode 100644
index 000000000..b7fea891f
--- /dev/null
+++ b/app/templates/events.gjs
@@ -0,0 +1,11 @@
+import RouteTemplate from 'ember-route-template'
+import EmberAnchor from "ember-api-docs/components/ember-anchor";
+import ApiIndexFilter from "ember-api-docs/components/api-index-filter";
+import ClassFieldDescription from "ember-api-docs/components/class-field-description";
+export default RouteTemplate(
+
+ {{#each filteredModel.events as |event|}}
+
+ {{/each}}
+
+ )
\ No newline at end of file
diff --git a/app/templates/events.hbs b/app/templates/events.hbs
deleted file mode 100644
index 0b6dd1739..000000000
--- a/app/templates/events.hbs
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- {{#each filteredModel.events as |event|}}
-
- {{/each}}
-
diff --git a/app/templates/head.gjs b/app/templates/head.gjs
new file mode 100644
index 000000000..58c71b45d
--- /dev/null
+++ b/app/templates/head.gjs
@@ -0,0 +1,14 @@
+import RouteTemplate from 'ember-route-template'
+
+export default RouteTemplate({{@controller.model.title}}
+
+
+
+
+{{#if @controller.model.description}}
+
+
+{{/if}}
+{{#unless @controller.model.isRelease}}
+
+{{/unless}} )
\ No newline at end of file
diff --git a/app/templates/head.hbs b/app/templates/head.hbs
deleted file mode 100644
index b67e03fa9..000000000
--- a/app/templates/head.hbs
+++ /dev/null
@@ -1,12 +0,0 @@
-
{{this.model.title}}
-
-
-
-
-{{#if this.model.description}}
-
-
-{{/if}}
-{{#unless this.model.isRelease}}
-
-{{/unless}}
\ No newline at end of file
diff --git a/app/templates/loading.gjs b/app/templates/loading.gjs
new file mode 100644
index 000000000..a3a4e3850
--- /dev/null
+++ b/app/templates/loading.gjs
@@ -0,0 +1,4 @@
+import RouteTemplate from 'ember-route-template'
+import LoadingSpinner from "ember-api-docs/components/loading-spinner";
+export default RouteTemplate(
+)
\ No newline at end of file
diff --git a/app/templates/loading.hbs b/app/templates/loading.hbs
deleted file mode 100644
index efb8b4ff5..000000000
--- a/app/templates/loading.hbs
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/templates/methods.gjs b/app/templates/methods.gjs
new file mode 100644
index 000000000..2557ee243
--- /dev/null
+++ b/app/templates/methods.gjs
@@ -0,0 +1,12 @@
+import RouteTemplate from 'ember-route-template'
+import EmberAnchor from "ember-api-docs/components/ember-anchor";
+import ApiIndexFilter from "ember-api-docs/components/api-index-filter";
+import ClassFieldDescription from "ember-api-docs/components/class-field-description";
+export default RouteTemplate(
{{!-- template-lint-disable no-action --}}
+
+
+ {{#each filteredModel.methods as |method|}}
+
+ {{/each}}
+
+ )
\ No newline at end of file
diff --git a/app/templates/methods.hbs b/app/templates/methods.hbs
deleted file mode 100644
index 1d1e03838..000000000
--- a/app/templates/methods.hbs
+++ /dev/null
@@ -1,7 +0,0 @@
-{{! template-lint-disable no-action }}
-
-
- {{#each filteredModel.methods as |method|}}
-
- {{/each}}
-
diff --git a/app/templates/project-version.gjs b/app/templates/project-version.gjs
new file mode 100644
index 000000000..815c62ee4
--- /dev/null
+++ b/app/templates/project-version.gjs
@@ -0,0 +1,35 @@
+import RouteTemplate from 'ember-route-template'
+import { LinkTo } from "@ember/routing";
+import eq from "ember-api-docs/helpers/eq";
+import PowerSelect from "ember-power-select/components/power-select";
+import routeAction from "ember-route-action-helper/helpers/route-action";
+import TableOfContents from "ember-api-docs/components/table-of-contents";
+import versionLt from "ember-api-docs/helpers/version-lt";
+export default RouteTemplate(
{{!-- template-lint-disable no-inline-styles no-route-action --}}
+
+
+ )
\ No newline at end of file
diff --git a/app/templates/project-version.hbs b/app/templates/project-version.hbs
deleted file mode 100644
index b4ac9e8a3..000000000
--- a/app/templates/project-version.hbs
+++ /dev/null
@@ -1,44 +0,0 @@
-{{! template-lint-disable no-inline-styles }}
-
-
diff --git a/app/templates/project-version/classes/class.gjs b/app/templates/project-version/classes/class.gjs
new file mode 100644
index 000000000..97913e601
--- /dev/null
+++ b/app/templates/project-version/classes/class.gjs
@@ -0,0 +1,121 @@
+import RouteTemplate from 'ember-route-template'
+import and from "ember-truth-helpers/helpers/and";
+import isLatest from "ember-api-docs/helpers/is-latest";
+import githubLink from "ember-api-docs/helpers/github-link";
+import svgJar from "ember-svg-jar/helpers/svg-jar";
+import { LinkTo } from "@ember/routing";
+import { array, concat, hash } from "@ember/helper";
+import notEq from "ember-truth-helpers/helpers/not-eq";
+import not from "ember-truth-helpers/helpers/not";
+import eq from "ember-api-docs/helpers/eq";
+import ImportExample from "ember-api-docs/components/import-example";
+import MarkdownToHtml from "ember-cli-showdown/components/markdown-to-html";
+import or from "ember-truth-helpers/helpers/or";
+export default RouteTemplate(
{{!-- template-lint-disable no-action --}}
+
+ {{#if (and @model.project.id @model.file @model.line (isLatest version=@model.projectVersion.version allVersions=@controller.allVersions))}}
+ {{svgJar "fa-pencil"}}
+ {{/if}}
+ Class {{@model.name}}
+ {{#if @model.access}}{{@model.access}} {{/if}}
+
+
+ {{#if @model.extends}}
+
+ Extends:
+
+
+ {{@model.extends}}
+
+
+
+ {{/if}}
+ {{#if @model.uses}}
+
+ Uses:
+
+ {{#each @model.usesObjects as |parentClass idx|}}
+ {{#if (notEq idx 0)}}, {{/if}}
+ {{parentClass.name}}
+ {{/each}}
+
+
+ {{/if}}
+ {{#if @model.file}}
+
+ {{/if}}
+ {{#if @model.module}}
+
+ Module:
+
+
+ {{@model.module}}
+
+
+
+ {{/if}}
+ {{#if @model.since}}
+
+ Since:
+ v{{@model.since}}
+
+ {{/if}}
+
+ {{#if (and (not (eq @controller.static 1)) @controller.hasImportExample)}}
+
+ {{/if}}
+
+
+ {{#if (or @model.methods @model.properties @model.events)}}
+
+
+
+
+ {{outlet}}
+
+ {{/if}}
+
+
+ )
\ No newline at end of file
diff --git a/app/templates/project-version/classes/class.hbs b/app/templates/project-version/classes/class.hbs
deleted file mode 100644
index 85cacb66c..000000000
--- a/app/templates/project-version/classes/class.hbs
+++ /dev/null
@@ -1,130 +0,0 @@
-{{! template-lint-disable no-action }}
-
- {{#if (and @model.project.id @model.file @model.line (is-latest version=@model.projectVersion.version allVersions=this.allVersions))}}
- {{svg-jar "fa-pencil"}}
- {{/if}}
- Class {{@model.name}}
- {{#if @model.access}}{{@model.access}} {{/if}}
-
-
- {{#if @model.extends}}
-
- Extends:
-
-
- {{@model.extends}}
-
-
-
- {{/if}}
- {{#if @model.uses}}
-
- Uses:
-
- {{#each @model.usesObjects as |parentClass idx|}}
- {{#if (not-eq idx 0)}}, {{/if}}
- {{parentClass.name}}
- {{/each}}
-
-
- {{/if}}
- {{#if @model.file}}
-
- {{/if}}
- {{#if @model.module}}
-
- Module:
-
-
- {{@model.module}}
-
-
-
- {{/if}}
- {{#if @model.since}}
-
- Since:
- v{{@model.since}}
-
- {{/if}}
-
- {{#if (and (not (eq this.static 1)) this.hasImportExample)}}
-
- {{/if}}
-
-
- {{#if (or @model.methods @model.properties @model.events)}}
-
-
-
-
- {{outlet}}
-
- {{/if}}
-
-
diff --git a/app/templates/project-version/functions/function.gjs b/app/templates/project-version/functions/function.gjs
new file mode 100644
index 000000000..34fcda672
--- /dev/null
+++ b/app/templates/project-version/functions/function.gjs
@@ -0,0 +1,5 @@
+import RouteTemplate from 'ember-route-template'
+import ClassFieldDescription from "ember-api-docs/components/class-field-description";
+export default RouteTemplate(
Function
+
+)
\ No newline at end of file
diff --git a/app/templates/project-version/functions/function.hbs b/app/templates/project-version/functions/function.hbs
deleted file mode 100644
index 51acaf4da..000000000
--- a/app/templates/project-version/functions/function.hbs
+++ /dev/null
@@ -1,2 +0,0 @@
-
Function
-
diff --git a/app/templates/project-version/index.gjs b/app/templates/project-version/index.gjs
new file mode 100644
index 000000000..f63db5221
--- /dev/null
+++ b/app/templates/project-version/index.gjs
@@ -0,0 +1,10 @@
+import RouteTemplate from 'ember-route-template'
+import eq from "ember-api-docs/helpers/eq";
+import EmberDataLandingPage from "ember-api-docs/components/ember-data-landing-page";
+import EmberLandingPage from "ember-api-docs/components/ember-landing-page";
+export default RouteTemplate(
{{#if (eq @model.id "ember-data")}}
+
+{{else}}
+
+{{/if}}
+ )
\ No newline at end of file
diff --git a/app/templates/project-version/index.hbs b/app/templates/project-version/index.hbs
deleted file mode 100644
index af49c7180..000000000
--- a/app/templates/project-version/index.hbs
+++ /dev/null
@@ -1,5 +0,0 @@
-{{#if (eq @model.id "ember-data")}}
-
-{{else}}
-
-{{/if}}
diff --git a/app/templates/project-version/modules/module.gjs b/app/templates/project-version/modules/module.gjs
new file mode 100644
index 000000000..55c66ec92
--- /dev/null
+++ b/app/templates/project-version/modules/module.gjs
@@ -0,0 +1,95 @@
+import RouteTemplate from 'ember-route-template'
+import eq from "ember-api-docs/helpers/eq";
+import { LinkTo } from "@ember/routing";
+import { array } from "@ember/helper";
+import MarkdownToHtml from "ember-cli-showdown/components/markdown-to-html";
+import not from "ember-truth-helpers/helpers/not";
+import and from "ember-truth-helpers/helpers/and";
+import gt from "ember-truth-helpers/helpers/gt";
+import functionHeadingId from "ember-api-docs/helpers/function-heading-id";
+import betterGet from "ember-api-docs/helpers/better-get";
+export default RouteTemplate(
{{!-- template-lint-disable no-invalid-link-text --}}
+
+ {{#if (eq @controller.model.name "ember-data-overview")}}
+ EmberData Overview
+ {{else}}
+ Package {{@controller.model.name}}
+ {{/if}}
+ {{#if @controller.model.access}}{{@controller.model.access}} {{/if}}
+
+
+ {{#if @controller.model.parent}}
+
+ Parent:
+ {{@controller.model.parent}}
+
+ {{/if}}
+
+
+
+
+ {{#if @controller.submodules}}
+
+
+
+ Submodules
+
+
+ {{#each @controller.submodules as |module|}}
+
+
+ {{module}}
+
+
+ {{/each}}
+
+
+ {{/if}}
+
+ {{#if @controller.classesAndNamespaces}}
+
+
+
+ Classes
+
+
+ {{#each @controller.classesAndNamespaces as |klass|}}
+ {{#if (not (and (eq @controller.model.name "ember-data") (eq klass "Ember")))}}
+
+
+ {{klass}}
+
+
+ {{/if}}
+ {{/each}}
+
+
+ {{/if}}
+
+ {{#if (and @controller.functionHeadings (gt @controller.functionHeadings.length 0))}}
+
+
+
+ Functions
+
+ {{#each @controller.functionHeadings as |funcHeading|}}
+
+
+ {{funcHeading}}
+
+
+ {{#each (betterGet @controller.functions funcHeading) as |method|}}
+
+
+ {{method.name}}
+
+
+ {{/each}}
+
+ {{/each}}
+
+ {{/if}}
+ {{outlet}}
+
+
+ )
\ No newline at end of file
diff --git a/app/templates/project-version/modules/module.hbs b/app/templates/project-version/modules/module.hbs
deleted file mode 100644
index 314f9e4a5..000000000
--- a/app/templates/project-version/modules/module.hbs
+++ /dev/null
@@ -1,83 +0,0 @@
-
- {{#if (eq this.model.name 'ember-data-overview')}}
- EmberData Overview
- {{else}}
- Package {{this.model.name}}
- {{/if}}
- {{#if this.model.access}}{{this.model.access}} {{/if}}
-
-
- {{#if this.model.parent}}
-
- Parent:
- {{this.model.parent}}
-
- {{/if}}
-
-
-
-
- {{#if this.submodules}}
-
-
-
- Submodules
-
-
- {{#each this.submodules as |module|}}
-
-
- {{module}}
-
-
- {{/each}}
-
-
- {{/if}}
-
- {{#if this.classesAndNamespaces}}
-
-
-
- Classes
-
-
- {{#each this.classesAndNamespaces as |klass|}}
- {{#if (not (and (eq this.model.name "ember-data") (eq klass "Ember")))}}
-
-
- {{klass}}
-
-
- {{/if}}
- {{/each}}
-
-
- {{/if}}
-
- {{#if (and this.functionHeadings (gt this.functionHeadings.length 0)) }}
-
-
-
- Functions
-
- {{#each this.functionHeadings as |funcHeading|}}
-
-
- {{funcHeading}}
-
-
- {{#each (better-get this.functions funcHeading) as |method|}}
-
-
- {{method.name}}
-
-
- {{/each}}
-
- {{/each}}
-
- {{/if}}
- {{outlet}}
-
-
diff --git a/app/templates/properties.gjs b/app/templates/properties.gjs
new file mode 100644
index 000000000..6e2053eef
--- /dev/null
+++ b/app/templates/properties.gjs
@@ -0,0 +1,12 @@
+import RouteTemplate from 'ember-route-template'
+import EmberAnchor from "ember-api-docs/components/ember-anchor";
+import ApiIndexFilter from "ember-api-docs/components/api-index-filter";
+import ClassFieldDescription from "ember-api-docs/components/class-field-description";
+export default RouteTemplate(
{{!-- template-lint-disable no-action --}}
+
+
+ {{#each filteredModel.properties as |property|}}
+
+ {{/each}}
+
+ )
\ No newline at end of file
diff --git a/app/templates/properties.hbs b/app/templates/properties.hbs
deleted file mode 100644
index aadb2ef45..000000000
--- a/app/templates/properties.hbs
+++ /dev/null
@@ -1,7 +0,0 @@
-{{! template-lint-disable no-action }}
-
-
- {{#each filteredModel.properties as |property|}}
-
- {{/each}}
-
diff --git a/tests/integration/components/api-index-filter-test.js b/tests/integration/components/api-index-filter-test.gjs
similarity index 63%
rename from tests/integration/components/api-index-filter-test.js
rename to tests/integration/components/api-index-filter-test.gjs
index bacae9407..f2547cd47 100644
--- a/tests/integration/components/api-index-filter-test.js
+++ b/tests/integration/components/api-index-filter-test.gjs
@@ -1,8 +1,9 @@
+/* eslint-disable prettier/prettier */
import EmberObject from '@ember/object';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, click, findAll } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
+import ApiIndexFilter from "ember-api-docs/components/api-index-filter";
module('Integration | Component | api index filter', function (hooks) {
setupRenderingTest(hooks);
@@ -71,7 +72,8 @@ module('Integration | Component | api index filter', function (hooks) {
],
});
- test('clicking inherited shows inherited methods', async function (assert) {
+ test('clicking inherited shows inherited methods', async function (assert) {const self = this;
+
let filterData = EmberObject.create({
showInherited: false,
showProtected: false,
@@ -85,44 +87,32 @@ module('Integration | Component | api index filter', function (hooks) {
filterData.set(field, !filterData.get(field));
};
- await render(hbs`
- {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}}
+ await render(
+ {{#ApiIndexFilter model=self.model filterData=self.filterData as |myModel|}}
Methods
{{#each myModel.methods as |method|}}
- {{method.name}}
+ {{method.name}}
{{/each}}
- {{/api-index-filter}}
- `);
+ {{/ApiIndexFilter}}
+ );
await click('#inherited-toggle');
assert
@@ -136,7 +126,8 @@ module('Integration | Component | api index filter', function (hooks) {
.hasText('parentDoSomething', 'should display 1 inherited method');
});
- test('clicking private shows private methods', async function (assert) {
+ test('clicking private shows private methods', async function (assert) {const self = this;
+
let filterData = EmberObject.create({
showInherited: false,
showProtected: false,
@@ -150,44 +141,32 @@ module('Integration | Component | api index filter', function (hooks) {
filterData.set(field, !filterData.get(field));
};
- await render(hbs`
- {{#api-index-filter model=this.model filterData=this.filterData updateFilter=(action "updateFilter") as |myModel|}}
+ await render(
+ {{#ApiIndexFilter model=self.model filterData=self.filterData updateFilter=(action "updateFilter") as |myModel|}}
Methods
{{#each myModel.methods as |method|}}
- {{method.name}}
+ {{method.name}}
{{/each}}
- {{/api-index-filter}}
- `);
+ {{/ApiIndexFilter}}
+ );
await click('#private-toggle');
assert
@@ -201,7 +180,8 @@ module('Integration | Component | api index filter', function (hooks) {
.hasText('doSomethingPrivate', 'should display 1 private method');
});
- test('clicking private and inherited shows both methods', async function (assert) {
+ test('clicking private and inherited shows both methods', async function (assert) {const self = this;
+
let filterData = EmberObject.create({
showInherited: false,
showProtected: false,
@@ -215,44 +195,32 @@ module('Integration | Component | api index filter', function (hooks) {
filterData.set(field, value);
};
- await render(hbs`
- {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}}
+ await render(
+ {{#ApiIndexFilter model=self.model filterData=self.filterData as |myModel|}}
Methods
{{#each myModel.methods as |method|}}
- {{method.name}}
+ {{method.name}}
{{/each}}
- {{/api-index-filter}}
- `);
+ {{/ApiIndexFilter}}
+ );
await click('#private-toggle');
await click('#inherited-toggle');
@@ -270,7 +238,8 @@ module('Integration | Component | api index filter', function (hooks) {
.hasText('parentDoSomething', 'should display 1 inherited method');
});
- test('clicking all toggles shows all methods', async function (assert) {
+ test('clicking all toggles shows all methods', async function (assert) {const self = this;
+
let filterData = EmberObject.create({
showInherited: false,
showProtected: false,
@@ -284,44 +253,32 @@ module('Integration | Component | api index filter', function (hooks) {
filterData.set(field, !filterData.get(field));
};
- await render(hbs`
- {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}}
+ await render(
+ {{#ApiIndexFilter model=self.model filterData=self.filterData as |myModel|}}
Methods
{{#each myModel.methods as |method|}}
- {{method.name}}
+ {{method.name}}
{{/each}}
- {{/api-index-filter}}
- `);
+ {{/ApiIndexFilter}}
+ );
await click('#private-toggle');
await click('#inherited-toggle');
@@ -347,7 +304,8 @@ module('Integration | Component | api index filter', function (hooks) {
.hasText('parentDoSomething', 'should display 1 inherited method');
});
- test('clicking all toggles off should only show public', async function (assert) {
+ test('clicking all toggles off should only show public', async function (assert) {const self = this;
+
let filterData = EmberObject.create({
showInherited: true,
showProtected: true,
@@ -361,44 +319,32 @@ module('Integration | Component | api index filter', function (hooks) {
filterData.set(field, !filterData.get(field));
};
- await render(hbs`
- {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}}
+ await render(
+ {{#ApiIndexFilter model=self.model filterData=self.filterData as |myModel|}}
Methods
{{#each myModel.methods as |method|}}
- {{method.name}}
+ {{method.name}}
{{/each}}
- {{/api-index-filter}}
- `);
+ {{/ApiIndexFilter}}
+ );
assert
.dom('.method-name')
@@ -432,7 +378,8 @@ module('Integration | Component | api index filter', function (hooks) {
.hasText('doSomething', 'should display 1 public method');
});
- test('should show only local method implementation when duplicates', async function (assert) {
+ test('should show only local method implementation when duplicates', async function (assert) {const self = this;
+
let filterData = EmberObject.create({
showInherited: true,
showProtected: false,
@@ -443,14 +390,14 @@ module('Integration | Component | api index filter', function (hooks) {
this.set('model', model);
this.set('filterData', filterData);
- await render(hbs`
- {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}}
+ await render(
+ {{#ApiIndexFilter model=self.model filterData=self.filterData as |myModel|}}
Methods
{{#each myModel.methods as |method|}}
- {{method.name}}
+ {{method.name}}
{{/each}}
- {{/api-index-filter}}
- `);
+ {{/ApiIndexFilter}}
+ );
assert
.dom('.method-name')
.exists(
diff --git a/tests/integration/components/api-index-test.js b/tests/integration/components/api-index-test.gjs
similarity index 69%
rename from tests/integration/components/api-index-test.js
rename to tests/integration/components/api-index-test.gjs
index e862ca666..5f9bc9763 100644
--- a/tests/integration/components/api-index-test.js
+++ b/tests/integration/components/api-index-test.gjs
@@ -2,7 +2,10 @@ import EmberObject from '@ember/object';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, click, findAll } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
+import ApiIndex from "ember-api-docs/components/api-index";
+import { LinkTo } from "@ember/routing";
+import { array, hash } from "@ember/helper";
+import ApiIndexFilter from "ember-api-docs/components/api-index-filter";
module('Integration | Component | api index', function (hooks) {
setupRenderingTest(hooks);
@@ -13,7 +16,8 @@ module('Integration | Component | api index', function (hooks) {
this.actions[actionName].apply(this, args);
});
- test('should display api index', async function (assert) {
+ test('should display api index', async function (assert) {const self = this;
+
let model = EmberObject.create({
project: {
id: 'lolwut',
@@ -44,24 +48,15 @@ module('Integration | Component | api index', function (hooks) {
this.set('myModel', model);
// Template block usage:
- await render(hbs`
- {{#api-index itemData=this.myModel as |sectionData|}}
+ await render(
+ {{#ApiIndex itemData=self.myModel as |sectionData|}}
{{#each sectionData.sections as |section|}}
- {{section.title}}
+ {{section.title}}
{{#if section.items}}
-
+
{{#each section.items as |item|}}
-
+
{{item.name}}
@@ -71,8 +66,8 @@ module('Integration | Component | api index', function (hooks) {
No documented items
{{/if}}
{{/each}}
- {{/api-index}}
- `);
+ {{/ApiIndex}}
+ );
assert
.dom('.api-index-section-title')
.exists({ count: 3 }, 'should show 3 sections');
@@ -96,7 +91,8 @@ module('Integration | Component | api index', function (hooks) {
.hasText('didSomething', 'should display 1 event');
});
- test('should display text when no methods', async function (assert) {
+ test('should display text when no methods', async function (assert) {const self = this;
+
let model = EmberObject.create({
project: {
id: 'lolwut',
@@ -122,24 +118,15 @@ module('Integration | Component | api index', function (hooks) {
this.set('myModel', model);
// Template block usage:
- await render(hbs`
- {{#api-index itemData=this.myModel as |sectionData|}}
+ await render(
+ {{#ApiIndex itemData=self.myModel as |sectionData|}}
{{#each sectionData.sections as |section|}}
- {{section.title}}
+ {{section.title}}
{{#if section.items}}
-
+
{{#each section.items as |item|}}
-
+
{{item.name}}
@@ -149,8 +136,8 @@ module('Integration | Component | api index', function (hooks) {
No documented items
{{/if}}
{{/each}}
- {{/api-index}}
- `);
+ {{/ApiIndex}}
+ );
assert
.dom('.api-index-section-title')
.exists({ count: 3 }, 'should show 3 sections');
@@ -174,7 +161,8 @@ module('Integration | Component | api index', function (hooks) {
.hasText('didSomething', 'should display 1 event');
});
- test('should display api index with filter', async function (assert) {
+ test('should display api index with filter', async function (assert) {const self = this;
+
let model = EmberObject.create({
project: {
id: 'lolwut',
@@ -236,56 +224,35 @@ module('Integration | Component | api index', function (hooks) {
};
// Template block usage:
- await render(hbs`
- {{#api-index-filter model=this.myModel filterData=this.filterData as |filteredModel|}}
+ await render(
+ {{#ApiIndexFilter model=self.myModel filterData=self.filterData as |filteredModel|}}
- {{#api-index itemData=filteredModel as |sectionData|}}
+ {{#ApiIndex itemData=filteredModel as |sectionData|}}
{{#each sectionData.sections as |section|}}
- {{section.title}}
+ {{section.title}}
{{#if section.items}}
-
+
{{#each section.items as |item|}}
-
+
{{item.name}}
@@ -295,9 +262,9 @@ module('Integration | Component | api index', function (hooks) {
No documented items
{{/if}}
{{/each}}
- {{/api-index}}
- {{/api-index-filter}}
- `);
+ {{/ApiIndex}}
+ {{/ApiIndexFilter}}
+ );
assert
.dom('.api-index-section-title')
.exists({ count: 3 }, 'should show 3 sections');
@@ -321,7 +288,8 @@ module('Integration | Component | api index', function (hooks) {
.hasText('didSomething', 'should display 1 event');
});
- test('should display inherited method when show inherited toggled on', async function (assert) {
+ test('should display inherited method when show inherited toggled on', async function (assert) {const self = this;
+
let model = EmberObject.create({
project: {
id: 'lolwut',
@@ -382,57 +350,36 @@ module('Integration | Component | api index', function (hooks) {
filterData.set(field, !filterData.get(field));
};
- await render(hbs`
- {{#api-index-filter model=this.myModel filterData=this.filterData as |filteredModel|}}
+ await render(
+ {{#ApiIndexFilter model=self.myModel filterData=self.filterData as |filteredModel|}}
- {{#api-index itemData=filteredModel as |sectionData|}}
+ {{#ApiIndex itemData=filteredModel as |sectionData|}}
{{#each sectionData.sections as |section|}}
- {{section.title}}
+ {{section.title}}
{{#if section.items}}
-
+
{{#each section.items as |item|}}
-
+
{{item.name}}
@@ -442,9 +389,9 @@ module('Integration | Component | api index', function (hooks) {
No documented items
{{/if}}
{{/each}}
- {{/api-index}}
- {{/api-index-filter}}
- `);
+ {{/ApiIndex}}
+ {{/ApiIndexFilter}}
+ );
assert
.dom('.api-index-section-title')
.exists({ count: 3 }, 'should show 3 sections');
diff --git a/tests/integration/components/class-field-description-test.js b/tests/integration/components/class-field-description-test.gjs
similarity index 76%
rename from tests/integration/components/class-field-description-test.js
rename to tests/integration/components/class-field-description-test.gjs
index 7bb0a9277..f8856ae35 100644
--- a/tests/integration/components/class-field-description-test.js
+++ b/tests/integration/components/class-field-description-test.gjs
@@ -1,19 +1,15 @@
+/* eslint-disable prettier/prettier */
import EmberObject from '@ember/object';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import {
- render,
- click,
- findAll,
- find,
- triggerEvent,
-} from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
+import { render, click, findAll, find, triggerEvent } from '@ember/test-helpers';
+import ClassFieldDescription from "ember-api-docs/components/class-field-description";
module('Integration | Component | class field description', function (hooks) {
setupRenderingTest(hooks);
- test('it renders', async function (assert) {
+ test('it renders', async function (assert) {const self = this;
+
this.set('type', 'method');
this.set(
'field',
@@ -27,7 +23,7 @@ module('Integration | Component | class field description', function (hooks) {
);
await render(
- hbs`
`
+
);
assert.dom('.method-name').hasText('concat');
@@ -36,7 +32,8 @@ module('Integration | Component | class field description', function (hooks) {
assert.dom(findAll('.args')[0]).hasText('(param1, param2, param3)');
});
- test('On hover -- the link icon shows up', async function (assert) {
+ test('On hover -- the link icon shows up', async function (assert) {const self = this;
+
this.set('type', 'method');
this.set(
'field',
@@ -50,7 +47,7 @@ module('Integration | Component | class field description', function (hooks) {
);
await render(
- hbs`
`
+
);
await triggerEvent('.class-field-description--link', 'mouseenter');
@@ -59,7 +56,8 @@ module('Integration | Component | class field description', function (hooks) {
.exists('The link icon appears when hovering on the method text');
});
- test('it calls the provided action on link-click with the field name as an arg', async function (assert) {
+ test('it calls the provided action on link-click with the field name as an arg', async function (assert) {const self = this;
+
assert.expect(3);
this.set('updateAnchor', (name) => {
assert.equal(
@@ -78,7 +76,7 @@ module('Integration | Component | class field description', function (hooks) {
);
await render(
- hbs`
`
+
);
await click('.class-field-description--link');
@@ -86,7 +84,8 @@ module('Integration | Component | class field description', function (hooks) {
assert.verifySteps(['updateAnchorAction']);
});
- test('parameter props are displayed', async function (assert) {
+ test('parameter props are displayed', async function (assert) {const self = this;
+
this.set('type', 'method');
this.set(
'field',
@@ -104,7 +103,7 @@ module('Integration | Component | class field description', function (hooks) {
);
await render(
- hbs`
`
+
);
assert.dom(find('.prop:nth-child(1) dt')).hasText('prop1');
diff --git a/tests/integration/components/import-example-test.js b/tests/integration/components/import-example-test.gjs
similarity index 66%
rename from tests/integration/components/import-example-test.js
rename to tests/integration/components/import-example-test.gjs
index 3e0813391..2015220d7 100644
--- a/tests/integration/components/import-example-test.js
+++ b/tests/integration/components/import-example-test.gjs
@@ -1,21 +1,22 @@
+/* eslint-disable prettier/prettier */
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
+import ImportExample from "ember-api-docs/components/import-example";
module('Integration | Component | import example', function (hooks) {
setupRenderingTest(hooks);
test('it renders a class import example', async function (assert) {
await render(
- hbs`
`
+
);
assert.dom('*').hasText("import Application from '@ember/application';");
});
test('it renders a function import example', async function (assert) {
await render(
- hbs`
`
+
);
assert.dom('*').hasText("import { uniqBy } from '@ember/object/computed';");
});
diff --git a/tests/integration/components/loading-spinner-test.js b/tests/integration/components/loading-spinner-test.gjs
similarity index 77%
rename from tests/integration/components/loading-spinner-test.js
rename to tests/integration/components/loading-spinner-test.gjs
index 00edc93b1..9d714a767 100644
--- a/tests/integration/components/loading-spinner-test.js
+++ b/tests/integration/components/loading-spinner-test.gjs
@@ -1,7 +1,7 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
+import LoadingSpinner from "ember-api-docs/components/loading-spinner";
module('Integration | Component | loading spinner', function (hooks) {
setupRenderingTest(hooks);
@@ -10,16 +10,16 @@ module('Integration | Component | loading spinner', function (hooks) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
- await render(hbs`
`);
+ await render(
);
assert.dom('*').hasText('');
// Template block usage:
- await render(hbs`
+ await render(
template block text
- `);
+ );
assert.dom('*').hasText('template block text');
});
diff --git a/tests/integration/components/search-input-test.js b/tests/integration/components/search-input-test.gjs
similarity index 96%
rename from tests/integration/components/search-input-test.js
rename to tests/integration/components/search-input-test.gjs
index 1a012fb54..41c795852 100644
--- a/tests/integration/components/search-input-test.js
+++ b/tests/integration/components/search-input-test.gjs
@@ -1,8 +1,8 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { fillIn, render, waitFor } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
import { set } from '@ember/object';
+import SearchInput from "ember-api-docs/components/search-input";
module('Integration | Component | search input', function (hooks) {
setupRenderingTest(hooks);
@@ -155,7 +155,7 @@ module('Integration | Component | search input', function (hooks) {
];
});
- await render(hbs`
`);
+ await render(
);
await fillIn('#search-input', 'model');
@@ -171,7 +171,7 @@ module('Integration | Component | search input', function (hooks) {
return [];
});
- await render(hbs`
`);
+ await render(
);
await fillIn('#search-input', 'model');
diff --git a/tests/integration/components/table-of-contents-test.js b/tests/integration/components/table-of-contents-test.gjs
similarity index 77%
rename from tests/integration/components/table-of-contents-test.js
rename to tests/integration/components/table-of-contents-test.gjs
index 9b8e80027..e6e84c9f2 100644
--- a/tests/integration/components/table-of-contents-test.js
+++ b/tests/integration/components/table-of-contents-test.gjs
@@ -1,7 +1,8 @@
+/* eslint-disable prettier/prettier */
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, findAll, click } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
+import TableOfContents from "ember-api-docs/components/table-of-contents";
const TIMEOUT_FOR_ANIMATION = 600;
const CLASSES = ['Descriptor', 'Ember'];
@@ -10,19 +11,15 @@ const MODULES = ['@ember/application', '@ember/array'];
module('Integration | Component | table of contents', function (hooks) {
setupRenderingTest(hooks);
- test('it renders', async function (assert) {
+ test('it renders', async function (assert) {const self = this;
+
// Set any properties with this.set('myProperty', 'value');
this.set('emberVersion', '2.4.3');
this.set('classesIDs', CLASSES);
- await render(hbs`
-
- `);
+ await render(
+
+ );
const contentTitle = document.querySelector(
'[data-test-toc-title="classes"]'
@@ -37,19 +34,15 @@ module('Integration | Component | table of contents', function (hooks) {
assert.dom(findAll(`${contentReference} li`)[1]).hasText(CLASSES[1]);
});
- test('Starts with underlying content visible', async function (assert) {
+ test('Starts with underlying content visible', async function (assert) {const self = this;
+
// Set any properties with this.set('myProperty', 'value');
this.set('emberVersion', '2.4.3');
this.set('moduleIDs', MODULES);
- await render(hbs`
-
- `);
+ await render(
+
+ );
const contentReference = '.toc-level-1';
const content = document.querySelector(contentReference);
@@ -67,19 +60,15 @@ module('Integration | Component | table of contents', function (hooks) {
assert.dom(findAll(`${contentReference} li`)[1]).hasText(MODULES[1]);
});
- test('Underlying content hides once clicked', async function (assert) {
+ test('Underlying content hides once clicked', async function (assert) {const self = this;
+
// Set any properties with this.set('myProperty', 'value');
this.set('emberVersion', '2.4.3');
this.set('moduleIDs', MODULES);
- await render(hbs`
-
- `);
+ await render(
+
+ );
const contentTitle = document.querySelector(
'[data-test-toc-title="packages"]'
@@ -101,19 +90,15 @@ module('Integration | Component | table of contents', function (hooks) {
}, TIMEOUT_FOR_ANIMATION);
});
- test('Underlying content should be visible after 2 clicks', async function (assert) {
+ test('Underlying content should be visible after 2 clicks', async function (assert) {const self = this;
+
// Set any properties with this.set('myProperty', 'value');
this.set('emberVersion', '2.4.3');
this.set('moduleIDs', MODULES);
- await render(hbs`
-
- `);
+ await render(
+
+ );
const titleButton = document.querySelector(
'[data-test-toc-title="packages"]'
diff --git a/tests/integration/helpers/better-get-test.js b/tests/integration/helpers/better-get-test.gjs
similarity index 60%
rename from tests/integration/helpers/better-get-test.js
rename to tests/integration/helpers/better-get-test.gjs
index 6140bfdc9..00d15c462 100644
--- a/tests/integration/helpers/better-get-test.js
+++ b/tests/integration/helpers/better-get-test.gjs
@@ -1,31 +1,33 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
+import betterGet from "ember-api-docs/helpers/better-get";
module('helper:better-get', function (hooks) {
setupRenderingTest(hooks);
- test('should get dot separated', async function (assert) {
+ test('should get dot separated', async function (assert) {const self = this;
+
let obj = {
'Ember.Object': 'hello',
};
this.set('dataStructure', obj);
this.set('key', 'Ember.Object');
- await render(hbs`{{better-get dataStructure key}}`);
+ await render(
{{betterGet self.dataStructure self.key}} );
assert.dom(this.element).hasText('hello');
});
- test('should get rfc 176 module', async function (assert) {
+ test('should get rfc 176 module', async function (assert) {const self = this;
+
let obj = {
'@ember/object': 'hello',
};
this.set('dataStructure', obj);
this.set('key', '@ember/object');
- await render(hbs`{{better-get dataStructure key}}`);
+ await render(
{{betterGet self.dataStructure self.key}} );
assert.dom(this.element).hasText('hello');
});
diff --git a/tests/integration/helpers/function-heading-id-test.js b/tests/integration/helpers/function-heading-id-test.gjs
similarity index 69%
rename from tests/integration/helpers/function-heading-id-test.js
rename to tests/integration/helpers/function-heading-id-test.gjs
index afe4403c0..343f56e53 100644
--- a/tests/integration/helpers/function-heading-id-test.js
+++ b/tests/integration/helpers/function-heading-id-test.gjs
@@ -1,15 +1,16 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
+import functionHeadingId from "ember-api-docs/helpers/function-heading-id";
module('helper:function-heading-id', function (hooks) {
setupRenderingTest(hooks);
- test('should transform nested package to id', async function (assert) {
+ test('should transform nested package to id', async function (assert) {const self = this;
+
this.set('inputValue', '@ember/object/computed');
- await render(hbs`{{function-heading-id inputValue}}`);
+ await render(
{{functionHeadingId self.inputValue}} );
assert.dom(this.element).hasText('functions-computed');
});
diff --git a/tests/integration/helpers/is-latest-test.js b/tests/integration/helpers/is-latest-test.gjs
similarity index 69%
rename from tests/integration/helpers/is-latest-test.js
rename to tests/integration/helpers/is-latest-test.gjs
index 35d18488e..095ef9358 100644
--- a/tests/integration/helpers/is-latest-test.js
+++ b/tests/integration/helpers/is-latest-test.gjs
@@ -1,35 +1,37 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
import { A } from '@ember/array';
+import isLatest from "ember-api-docs/helpers/is-latest";
const versions = A(['ember-1.13.0', 'ember-3.5.0', 'ember-2.1.10']);
module('helper:is-latest', function (hooks) {
setupRenderingTest(hooks);
- test('should resolve true if latest release', async function (assert) {
+ test('should resolve true if latest release', async function (assert) {const self = this;
+
this.set('version', '3.5.0');
this.set('allVersions', versions);
- await render(hbs`
- {{#if (is-latest version=this.version allVersions=this.allVersions)}}
+ await render(
+ {{#if (isLatest version=self.version allVersions=self.allVersions)}}
Hello World
{{/if}}
- `);
+ );
assert.dom(this.element).hasText('Hello World');
});
- test('should resolve false if not latest', async function (assert) {
+ test('should resolve false if not latest', async function (assert) {const self = this;
+
this.set('version', '3.1.0');
this.set('allVersions', versions);
- await render(hbs`
- {{#if (is-latest version=this.version allVersions=this.allVersions)}}
+ await render(
+ {{#if (isLatest version=self.version allVersions=self.allVersions)}}
Hello World
{{/if}}
- `);
+ );
assert.notEqual(this.element.textContent.trim(), 'Hello World');
});
});
diff --git a/tests/integration/helpers/version-lt-test.js b/tests/integration/helpers/version-lt-test.gjs
similarity index 65%
rename from tests/integration/helpers/version-lt-test.js
rename to tests/integration/helpers/version-lt-test.gjs
index 297671b2e..23b56856f 100644
--- a/tests/integration/helpers/version-lt-test.js
+++ b/tests/integration/helpers/version-lt-test.gjs
@@ -1,33 +1,33 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
+import versionLt from "ember-api-docs/helpers/version-lt";
module('helper:version-lt', function (hooks) {
setupRenderingTest(hooks);
test('should calculate major version diffs', async function (assert) {
- await render(hbs`{{version-lt '2.10' '3.0' 'ember'}}`);
+ await render(
{{versionLt "2.10" "3.0" "ember"}} );
assert.dom(this.element).hasText('true');
});
test('should calculate minor version diffs', async function (assert) {
- await render(hbs`{{version-lt '2.15' '2.16' 'ember'}}`);
+ await render(
{{versionLt "2.15" "2.16" "ember"}} );
assert.dom(this.element).hasText('true');
});
test('should fail if major greater', async function (assert) {
- await render(hbs`{{version-lt '3.0' '2.16' 'ember'}}`);
+ await render(
{{versionLt "3.0" "2.16" "ember"}} );
assert.dom(this.element).hasText('false');
});
test('should fail if minor greater', async function (assert) {
- await render(hbs`{{version-lt '2.17' '2.16' 'ember'}}`);
+ await render(
{{versionLt "2.17" "2.16" "ember"}} );
assert.dom(this.element).hasText('false');
});
test('should fail if equal', async function (assert) {
- await render(hbs`{{version-lt '2.16' '2.16' 'ember'}}`);
+ await render(
{{versionLt "2.16" "2.16" "ember"}} );
assert.dom(this.element).hasText('false');
});
});