import { test } from 'qunit';
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';

moduleForAcceptance('Acceptance | routeless engine demo');

test('can invoke components directly in an engine and also that are dependencies of an engine', async function(
  assert
) {
  await visit('/routeless-engine-demo');

  assert.equal(currentURL(), '/routeless-engine-demo');

  assert.equal(
    this.application
    .$('.hello .greeting')
    .text()
    .trim(),
    'Hello'
  );
  assert.equal(
    this.application
    .$('.hola .greeting')
    .text()
    .trim(),
    'Hola'
  );
});

test('can rerender a component in a routeless engine', async function(assert) {
  await visit('/routeless-engine-demo');

  let $clickCount = find('.click-count');
  assert.equal($clickCount.text().trim(), '0');

  await click('button.clicker');

  assert.equal($clickCount.text().trim(), '1');
});

@@ -1,16 +1,24 @@
 import %7B
+ module,
  test %7D 
@@ -42,139 +42,222 @@
 ort 
-moduleForAcceptance
+%7B setupApplicationTest %7D from 'ember-qunit';%0Aimport %7B currentURL, visit, find, click %7D
  from '
-../..
+@ember
 /test
-s/
+-
 helpers
-/module-for-acceptance';%0A%0AmoduleForAcceptance('Acceptance %7C routeless engine demo'
+';%0A%0Amodule('Acceptance %7C routeless engine demo', function (hooks) %7B%0A  setupApplicationTest(hooks
 );%0A%0A
+  
 test
@@ -362,18 +362,21 @@
 function
+ 
 (%0A
+  
   assert
@@ -376,20 +376,24 @@
  assert%0A
+  
 ) %7B%0A
+  
   await 
@@ -420,32 +420,34 @@
 gine-demo');%0A%0A  
+ 
+ 
 assert.equal(cur
@@ -481,24 +481,26 @@
 ne-demo');%0A%0A
+  
   assert.equ
@@ -506,36 +506,12 @@
 ual(
-%0A    this.application%0A    .$
+find
 ('.h
@@ -530,33 +530,28 @@
 ng')
-%0A    .text()%0A    
+.textContent
 .trim(),
 %0A   
@@ -550,20 +550,16 @@
 m(),
-%0A   
  'Hello'
 %0A  )
@@ -554,22 +554,21 @@
  'Hello'
-%0A  
 );%0A
+  
   assert
@@ -578,36 +578,12 @@
 ual(
-%0A    this.application%0A    .$
+find
 ('.h
@@ -601,33 +601,28 @@
 ng')
-%0A    .text()%0A    
+.textContent
 .trim(),
 %0A   
@@ -621,30 +621,27 @@
 m(),
-%0A   
  'Hola'
+);
 %0A  
-);%0A
 %7D);%0A%0A
+  
 test
@@ -705,16 +705,17 @@
 function
+ 
 (assert)
@@ -717,16 +717,18 @@
 sert) %7B%0A
+  
   await 
@@ -765,15 +765,16 @@
 );%0A%0A
+  
   let 
-$
 clic
@@ -804,16 +804,18 @@
 ount');%0A
+  
   assert
@@ -813,33 +813,32 @@
    assert.equal(
-$
 clickCount.text(
@@ -828,34 +828,39 @@
 (clickCount.text
-()
+Content
 .trim(), '0');%0A%0A
@@ -859,16 +859,18 @@
  '0');%0A%0A
+  
   await 
@@ -895,16 +895,18 @@
 ker');%0A%0A
+  
   assert
@@ -916,9 +916,8 @@
 ual(
-$
 clic
@@ -927,18 +927,23 @@
 unt.text
-()
+Content
 .trim(),
@@ -949,12 +949,18 @@
 , '1');%0A
+  %7D);%0A
 %7D);%0A

migrate routeless-engine-demo test to new API