bottender-compose
Version:
An utility library for bottender and higher-order handlers
19 lines (16 loc) • 561 B
JavaScript
;
const setDisplayName = require('../setDisplayName');
const {
sendText
} = require('..');
it('should create a named action', async () => {
const Cool = sendText('cool');
const Action = setDisplayName('SayCool', Cool);
expect(Action).toHaveProperty('name', 'SayCool');
expect(Action).toHaveProperty('displayName', 'SayCool');
});
it('should create a named action using curry', async () => {
const Cool = sendText('cool');
const Action = setDisplayName('SayCool')(Cool);
expect(Action).toHaveProperty('displayName', 'SayCool');
});