-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
43 lines (41 loc) · 1.73 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// "use strict";
var phraser = require('activity-phraser');
var mocks = require('activity-mocks');
var assert = require('chai').assert;
var sinon = require('sinon');
describe('activity-element.phraser', function () {
it('phrases a simple activity', function () {
var phrase = phraser.phrase({
actor: 'ben',
verb: 'post',
object: 'activity-phraser'
});
assert.equal(phrase, 'ben posted activity-phraser');
});
it('phrases livefyre.sitePostCollection activity', function () {
var phrase = phraser.phrase(mocks.livefyre.sitePostCollection);
assert.typeOf(phrase, 'string');
assert.equal(phrase, 'site 222 verb "My Collection"');
});
it('phrases livefyre.userPostMessage activity', function () {
var phrase = phraser.phrase(mocks.livefyre.userPostMessage);
assert.typeOf(phrase, 'string');
assert.equal(phrase, 'Bob Doe posted the message "This is a comment post."');
});
it('phrases spec.basicWithDetail activity', function () {
var phrase = phraser.phrase(mocks.spec.basicWithDetail);
assert.typeOf(phrase, 'string');
assert.equal(phrase, 'Martin Smith posted "Why I love Activity Streams"');
});
it('phrases spec.extended activity', function () {
var phrase = phraser.phrase(mocks.spec.extended);
assert.typeOf(phrase, 'string');
assert.equal(phrase, 'Martin Smith posted a Photo');
});
it('phrases spec.minimal activity', function () {
var phrase = phraser.phrase(mocks.spec.minimal);
assert.typeOf(phrase, 'string');
// this could be improved...
assert.equal(phrase, 'urn:example:person:martin posted a link');
})
});