import {
  introJSNext,
  introJSPrevious,
  introJSExit,
  introJSEnsureClosed,
  introJSCurrentStep } from './../helpers/ember-introjs';
import { expect } from 'chai';
import { describe, it, beforeEach, afterEach } from 'mocha';
import { visit } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-mocha';

describe('test helpers', function() {
  setupApplicationTest();

  beforeEach(async function(){
    await visit('/');
  });

  afterEach(async function(){
    return await introJSEnsureClosed();
  });

  it('can use the next helper', async function(){
    await introJSNext();

    expect(introJSCurrentStep().intro).to.equal('Step 2!');
  });

  it('can use the exit helper', async function(){
    await introJSExit();

    expect(document.querySelector('.introjs-overlay')).to.equal(null);
  });

  it('can use the previous helper', async function(){
    await introJSNext();
    await introJSPrevious();

    expect(introJSCurrentStep().intro).to.equal('Step 1!');
  });
});

import {
  introJSNext,
  introJSPrevious,
  introJSExit,
  introJSEnsureClosed,
  introJSCurrentStep } from './../helpers/ember-introjs';
import { module, test } from 'qunit';
import { visit } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';

module('test helpers', function(hooks) {
  setupApplicationTest(hooks);

  hooks.beforeEach(async function() {
    await visit('/');
  });

  hooks.afterEach(async function() {
    return await introJSEnsureClosed();
  })

  test('can use the next helper', async function(assert) {
    await introJSNext();

    assert.equal(introJSCurrentStep().intro, 'Step 2!');
  });

  test('can use the exit helper', async function(assert){
    await introJSExit();

    assert.equal(document.querySelector('.introjs-overlay'), null);
  });

  test('can use the previous helper', async function(assert){
    await introJSNext();
    await introJSPrevious();

    assert.equal(introJSCurrentStep().intro, 'Step 1!');
  });
})

Fix tests in test helpers
Fix tests in test helpers
