Ghost/ghost/admin/tests/unit/transforms/twitter-url-user-test.js
Kevin Ansfield 1520122483 Refactored deprecated usage of setupTest* methods
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
2019-05-13 15:31:32 +01:00

24 lines
780 B
JavaScript

import {describe, it} from 'mocha';
import {expect} from 'chai';
import {setupTest} from 'ember-mocha';
describe('Unit: Transform: twitter-url-user', function () {
setupTest();
it('deserializes twitter url', function () {
let transform = this.owner.lookup('transform:twitter-url-user');
let serialized = '@testuser';
let result = transform.deserialize(serialized);
expect(result).to.equal('https://twitter.com/testuser');
});
it('serializes url to twitter username', function () {
let transform = this.owner.lookup('transform:twitter-url-user');
let deserialized = 'https://twitter.com/testuser';
let result = transform.serialize(deserialized);
expect(result).to.equal('@testuser');
});
});