open-consul/ui-v2/tests/unit/utils/confirm-test.js

18 lines
542 B
JavaScript

import { module } from 'qunit';
import test from 'ember-sinon-qunit/test-support/test';
import confirm from 'consul-ui/utils/confirm';
module('Unit | Utils | confirm', function() {
test('it resolves the result of the confirmation', function(assert) {
const expected = 'message';
// split this off into separate testing
const confirmation = function(actual) {
assert.equal(actual, expected);
return true;
};
return confirm(expected, confirmation).then(function(res) {
assert.ok(res);
});
});
});