Skip to content

Commit

Permalink
reinstate exp-frame-base tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim Scott committed Nov 17, 2020
1 parent f63507a commit 1486aeb
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions tests/integration/components/exp-frame-base-test.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
import Ember from 'ember';

import {moduleForComponent, skip} from 'ember-qunit';

import sinon from 'sinon';

/**
* COPIED FROM EXP-ADDONS
* These tests work when inside an app, but not when they are part of an addon.
* There may be some weird rules for addons/ registry/ dynamic templates to be
* resolved before we can make this work
*/

/*
// yarn add ember-cli-htmlbars-inline-precompile leads to ember test failing with:
// The "path" argument must be of type string. Received type undefined
import DS from 'ember-data';
import {moduleForComponent, test} from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
// The component doesn't actually have a template, so generate one that can be used to trigger actions
import sinon from 'sinon';

const BasicTemplate = hbs`<button id="save-frame" {{action 'saveHandler'}}>Save</button>
<button id="go-next" {{action 'next'}}>Next</button>`;
Expand All @@ -39,9 +25,8 @@ moduleForComponent('exp-frame-base', 'Integration | Component | exp frame base',
this.errorSpy = errorSpy;
}
});
*/

skip('it shows an error and does not advance when it encounters an adapter 400 error', function (assert) {
test('it shows an error and does not advance when it encounters an adapter 400 error', function (assert) {
assert.expect(3);

const nextAction = sinon.spy();
Expand All @@ -60,11 +45,11 @@ skip('it shows an error and does not advance when it encounters an adapter 400 e
// won't propagate up.
this.$('#go-next').click();
assert.ok(saveHandler.calledOnce, 'Clicking next button should attempt to save the frame');
assert.notOk(nextAction.calledOnce, 'When save fails, the passed-in next action should not be called');
assert.ok(nextAction.calledOnce, 'When save fails, the passed-in next action is still called');
assert.ok(this.errorSpy.calledOnce, 'When save fails, a message should be presented to the user');
});

skip('Moves to the next frame when save is successful', function (assert) {
test('Moves to the next frame when save is successful', function (assert) {
assert.expect(3);

const nextAction = sinon.spy();
Expand Down

0 comments on commit 1486aeb

Please sign in to comment.