Skip to content

Instantly share code, notes, and snippets.

@tbrd
Last active August 29, 2015 13:56
Show Gist options
  • Save tbrd/8972287 to your computer and use it in GitHub Desktop.
Save tbrd/8972287 to your computer and use it in GitHub Desktop.
Tests for keyword string processor
'use strict';
describeComponent('component/keyword-processor', function () {
// Initialize the component and attach it to the DOM
beforeEach(function () {
setupComponent();
});
it('should be defined', function () {
expect(this.component).toBeDefined();
});
it('should listen for ui-keywords and trigger data-keywords', function () {
var eventSpy = spyOnEvent(document, 'data-keywords');
this.$node.trigger('ui-keywords', {
keywords: 'london football'
});
expect(eventSpy).toHaveBeenTriggeredOn(document);
expect(eventSpy.mostRecentCall.data).toEqual({
keywords: ['london', 'football']
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment