Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions transforms/acceptance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test('visiting /foo', function(assert) {

```

**Output** (<small>[andthen.input.js](transforms/acceptance/__testfixtures__/andthen.output.js)</small>):
**Output** (<small>[andthen.output.js](transforms/acceptance/__testfixtures__/andthen.output.js)</small>):
```js
import { visit } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -110,7 +110,7 @@ test('visiting /foo', function(assert) {
});
```

**Output** (<small>[attr.input.js](transforms/acceptance/__testfixtures__/attr.output.js)</small>):
**Output** (<small>[attr.output.js](transforms/acceptance/__testfixtures__/attr.output.js)</small>):
```js
import { find } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -145,7 +145,7 @@ test('visiting /foo', function(assert) {

```

**Output** (<small>[click.input.js](transforms/acceptance/__testfixtures__/click.output.js)</small>):
**Output** (<small>[click.output.js](transforms/acceptance/__testfixtures__/click.output.js)</small>):
```js
import { click, currentURL, findAll, visit } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -198,7 +198,7 @@ test('function callback with one arg', function(assert) {

```

**Output** (<small>[each.input.js](transforms/acceptance/__testfixtures__/each.output.js)</small>):
**Output** (<small>[each.output.js](transforms/acceptance/__testfixtures__/each.output.js)</small>):
```js
import { findAll } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -253,7 +253,7 @@ test('visiting /foo', function(assert) {

```

**Output** (<small>[fill-in.input.js](transforms/acceptance/__testfixtures__/fill-in.output.js)</small>):
**Output** (<small>[fill-in.output.js](transforms/acceptance/__testfixtures__/fill-in.output.js)</small>):
```js
import { fillIn, currentURL, findAll, visit } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -285,7 +285,7 @@ test('visiting /foo', function(assert) {
});
```

**Output** (<small>[get-value.input.js](transforms/acceptance/__testfixtures__/get-value.output.js)</small>):
**Output** (<small>[get-value.output.js](transforms/acceptance/__testfixtures__/get-value.output.js)</small>):
```js
import { find } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -315,7 +315,7 @@ test('transforms get() correctly', function(assert) {

```

**Output** (<small>[get.input.js](transforms/acceptance/__testfixtures__/get.output.js)</small>):
**Output** (<small>[get.output.js](transforms/acceptance/__testfixtures__/get.output.js)</small>):
```js
import { findAll } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -345,7 +345,7 @@ test('visiting /foo', function(assert) {
});
```

**Output** (<small>[has-class.input.js](transforms/acceptance/__testfixtures__/has-class.output.js)</small>):
**Output** (<small>[has-class.output.js](transforms/acceptance/__testfixtures__/has-class.output.js)</small>):
```js
import { find } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -376,7 +376,7 @@ test('visiting /foo', function(assert) {
});
```

**Output** (<small>[html.input.js](transforms/acceptance/__testfixtures__/html.output.js)</small>):
**Output** (<small>[html.output.js](transforms/acceptance/__testfixtures__/html.output.js)</small>):
```js
import { find } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -412,7 +412,7 @@ test('visiting /foo', function(assert) {
});
```

**Output** (<small>[key-event.input.js](transforms/acceptance/__testfixtures__/key-event.output.js)</small>):
**Output** (<small>[key-event.output.js](transforms/acceptance/__testfixtures__/key-event.output.js)</small>):
```js
import { keyEvent, currentURL, visit } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -442,7 +442,7 @@ test('visiting /foo', function(assert) {
});
```

**Output** (<small>[length.input.js](transforms/acceptance/__testfixtures__/length.output.js)</small>):
**Output** (<small>[length.output.js](transforms/acceptance/__testfixtures__/length.output.js)</small>):
```js
import { findAll } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -496,7 +496,7 @@ test('visiting /twiddles', function(assert) {

```

**Output** (<small>[nested-in-and-then.input.js](transforms/acceptance/__testfixtures__/nested-in-and-then.output.js)</small>):
**Output** (<small>[nested-in-and-then.output.js](transforms/acceptance/__testfixtures__/nested-in-and-then.output.js)</small>):
```js
import { click } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -536,7 +536,7 @@ test('visiting /foo', function(assert) {
});
```

**Output** (<small>[prop.input.js](transforms/acceptance/__testfixtures__/prop.output.js)</small>):
**Output** (<small>[prop.output.js](transforms/acceptance/__testfixtures__/prop.output.js)</small>):
```js
import { find } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -567,7 +567,7 @@ test('visiting /foo', function(assert) {

```

**Output** (<small>[route-helpers.input.js](transforms/acceptance/__testfixtures__/route-helpers.output.js)</small>):
**Output** (<small>[route-helpers.output.js](transforms/acceptance/__testfixtures__/route-helpers.output.js)</small>):
```js
import { currentURL, currentPath, currentRouteName, visit } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -605,7 +605,7 @@ test(':selected is replaced correctly', function(assert) {

```

**Output** (<small>[selected.input.js](transforms/acceptance/__testfixtures__/selected.output.js)</small>):
**Output** (<small>[selected.output.js](transforms/acceptance/__testfixtures__/selected.output.js)</small>):
```js
import { find, findAll } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -639,7 +639,7 @@ test('visiting /foo', function(assert) {
});
```

**Output** (<small>[text.input.js](transforms/acceptance/__testfixtures__/text.output.js)</small>):
**Output** (<small>[text.output.js](transforms/acceptance/__testfixtures__/text.output.js)</small>):
```js
import { find } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -673,7 +673,7 @@ test('visiting /foo', function(assert) {
});
```

**Output** (<small>[trigger-event.input.js](transforms/acceptance/__testfixtures__/trigger-event.output.js)</small>):
**Output** (<small>[trigger-event.output.js](transforms/acceptance/__testfixtures__/trigger-event.output.js)</small>):
```js
import { currentURL, blur, focus, triggerEvent, visit } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -726,7 +726,7 @@ test('visiting /bar', async function(assert) {

```

**Output** (<small>[visit.input.js](transforms/acceptance/__testfixtures__/visit.output.js)</small>):
**Output** (<small>[visit.output.js](transforms/acceptance/__testfixtures__/visit.output.js)</small>):
```js
import { currentURL, visit } from '@ember/test-helpers';
import { test } from 'qunit';
Expand Down Expand Up @@ -755,4 +755,4 @@ test('visiting /bar', async function(assert) {
});

```
<!--FIXTURE_CONTENT_END-->
<!--FIXTURES_CONTENT_END-->
122 changes: 118 additions & 4 deletions transforms/ember-test-helper-api-migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ember-test-helpers-codemod ember-test-helper-api-migration path/of/files/ or/som
* [basic](#basic)
* [do-not-have-@ember-test-helpers-import](#do-not-have-@ember-test-helpers-import)
* [do-not-have-ember-test-helpers-import](#do-not-have-ember-test-helpers-import)
* [test-context-specifier](#test-context-specifier)
<!--FIXTURES_TOC_END-->

<!--FIXTURES_CONTENT_START-->
Expand All @@ -29,12 +30,24 @@ ember-test-helpers-codemod ember-test-helper-api-migration path/of/files/ or/som
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import { setResolver } from 'ember-test-helpers';

setResolver(engineResolverFor('shared-components'));

setApplication(Application.create(config.APP));
preloadAssets(manifest).then(start);

```

**Output** (<small>[basic.input.js](transforms/ember-test-helper-api-migration/__testfixtures__/basic.output.js)</small>):
**Output** (<small>[basic.output.js](transforms/ember-test-helper-api-migration/__testfixtures__/basic.output.js)</small>):
```js
import { setApplication, setResolver } from '@ember/test-helpers';
import { start } from 'ember-qunit';

setResolver(engineResolverFor('shared-components'));

setApplication(Application.create(config.APP));
preloadAssets(manifest).then(start);

```
---
<a id="do-not-have-@ember-test-helpers-import">**do-not-have-@ember-test-helpers-import**</a>
Expand All @@ -43,12 +56,24 @@ import { start } from 'ember-qunit';
```js
import { start } from 'ember-qunit';
import { setResolver } from 'ember-test-helpers';

setResolver(engineResolverFor('shared-components'));

setApplication(Application.create(config.APP));
preloadAssets(manifest).then(start);

```

**Output** (<small>[do-not-have-@ember-test-helpers-import.input.js](transforms/ember-test-helper-api-migration/__testfixtures__/[email protected])</small>):
**Output** (<small>[do-not-have-@ember-test-helpers-import.output.js](transforms/ember-test-helper-api-migration/__testfixtures__/[email protected])</small>):
```js
import { setResolver } from '@ember/test-helpers';
import { start } from 'ember-qunit';

setResolver(engineResolverFor('shared-components'));

setApplication(Application.create(config.APP));
preloadAssets(manifest).then(start);

```
---
<a id="do-not-have-ember-test-helpers-import">**do-not-have-ember-test-helpers-import**</a>
Expand All @@ -61,15 +86,104 @@ import hbs from 'htmlbars-inline-precompile';
moduleForComponent('foo-bar', 'Integration | Component | foo bar', {
integration: true
});

```

**Output** (<small>[do-not-have-ember-test-helpers-import.input.js](transforms/ember-test-helper-api-migration/__testfixtures__/do-not-have-ember-test-helpers-import.output.js)</small>):
**Output** (<small>[do-not-have-ember-test-helpers-import.output.js](transforms/ember-test-helper-api-migration/__testfixtures__/do-not-have-ember-test-helpers-import.output.js)</small>):
```js
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('foo-bar', 'Integration | Component | foo bar', {
integration: true
});

```
---
<a id="test-context-specifier">**test-context-specifier**</a>

**Input** (<small>[test-context-specifier.input.js](transforms/ember-test-helper-api-migration/__testfixtures__/test-context-specifier.input.js)</small>):
```js
import { click } from '@ember/test-helpers';
import { TestContext } from 'ember-test-helpers';
import { setupRenderingTest } from 'ember-qunit';
import { module, test } from 'qunit';


module(
'Integration | Component | c-pages/recommendations/collections/detail/collection-detail-card-list',
function (hooks) {
setupRenderingTest(hooks);

/** @type {TestContext['setProperties']} */
let setProperties;

hooks.beforeEach(function () {
setProperties = this.setProperties;

this.owner.register(
'service:lls-content-library@configuration',
ConfigurationStub
);
});

test('it renders detail view', async function (assert) {
await renderComponent({
learningCollectionItems,
locale,
isEditable: false
});

assert
.dom(SELECTORS.DROPDOWN_BUTTON)
.doesNotExist(
'It does not render dropdown button when `isEditable` is falsey'
);
});
}
);

```

**Output** (<small>[test-context-specifier.output.js](transforms/ember-test-helper-api-migration/__testfixtures__/test-context-specifier.output.js)</small>):
```js
import { click, TestContext } from '@ember/test-helpers';
import { setupRenderingTest } from 'ember-qunit';
import { module, test } from 'qunit';


module(
'Integration | Component | c-pages/recommendations/collections/detail/collection-detail-card-list',
function (hooks) {
setupRenderingTest(hooks);

/** @type {TestContext['setProperties']} */
let setProperties;

hooks.beforeEach(function () {
setProperties = this.setProperties;

this.owner.register(
'service:lls-content-library@configuration',
ConfigurationStub
);
});

test('it renders detail view', async function (assert) {
await renderComponent({
learningCollectionItems,
locale,
isEditable: false
});

assert
.dom(SELECTORS.DROPDOWN_BUTTON)
.doesNotExist(
'It does not render dropdown button when `isEditable` is falsey'
);
});
}
);

```
<!--FIXTURE_CONTENT_END-->
<!--FIXTURES_CONTENT_END-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { click } from '@ember/test-helpers';
import { TestContext } from 'ember-test-helpers';
import { setupRenderingTest } from 'ember-qunit';
import { module, test } from 'qunit';


module(
'Integration | Component | c-pages/recommendations/collections/detail/collection-detail-card-list',
function (hooks) {
setupRenderingTest(hooks);

/** @type {TestContext['setProperties']} */
let setProperties;

hooks.beforeEach(function () {
setProperties = this.setProperties;

this.owner.register(
'service:lls-content-library@configuration',
ConfigurationStub
);
});

test('it renders detail view', async function (assert) {
await renderComponent({
learningCollectionItems,
locale,
isEditable: false
});

assert
.dom(SELECTORS.DROPDOWN_BUTTON)
.doesNotExist(
'It does not render dropdown button when `isEditable` is falsey'
);
});
}
);
Loading