mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 16:42:17 +03:00
1520122483
no issue - https://github.com/emberjs/ember-mocha/blob/master/docs/migration.md#upgrading-to-the-new-testing-apis - deleted tests files which had no specific tests - migrated unskipped component unit tests to integration tests
25 lines
896 B
JavaScript
25 lines
896 B
JavaScript
import {describe, it} from 'mocha';
|
|
import {expect} from 'chai';
|
|
import {setupTest} from 'ember-mocha';
|
|
|
|
describe('Unit: Transform: json-string', function () {
|
|
setupTest();
|
|
|
|
it('serialises an Object to a JSON String', function () {
|
|
let transform = this.owner.lookup('transform:json-string');
|
|
let obj = {one: 'one', two: 'two'};
|
|
expect(transform.serialize(obj)).to.equal(JSON.stringify(obj));
|
|
});
|
|
|
|
it('deserialises a JSON String to an Object', function () {
|
|
let transform = this.owner.lookup('transform:json-string');
|
|
let obj = {one: 'one', two: 'two'};
|
|
expect(transform.deserialize(JSON.stringify(obj))).to.deep.equal(obj);
|
|
});
|
|
|
|
it('handles deserializing a blank string', function () {
|
|
let transform = this.owner.lookup('transform:json-string');
|
|
expect(transform.deserialize('')).to.equal(null);
|
|
});
|
|
});
|