isFulfilled
is not a feature of Promises in general. It’s a feature of PromiseProxy. You’re probably getting a PromiseProxy because that’s what ember-data returns.
If you want, in your test you can also make a PromiseProxy, so that the test acts like the real usage. The page I just linked starts with a code snippet showing how.
Alternatively, there are a couple other patterns that I think are less confusing and easier to test.
-
the most Emberish idiom is to try to keep as much data loading as possible in your Routes. I wrote a lot more about that topic here.
-
or you can use ember-promise-helpers in order to make your template deal correctly with any Promise (without requiring a PromiseProxy). It could look something like
{{#with (await totalAmount) as |resolvedAmount|}} <p data-test-total-amount>{{numeral-format (if resolvedAmount.count resolvedAmount.count 0)}}</p> {{{/with}}
Also, this is a tangential suggestion but it may be helpful since you’re learning about Promises. This:
var uniqueInteractions = new Promise(function(resolve) {
return resolve("459");
});
Can be said like this instead:
var uniqueInteractions = Promise.resolve("459");
It’s not Ember-specific, it’s a native Javascript Promise feature.