Created
August 15, 2013 18:24
-
-
Save brycec/6243349 to your computer and use it in GitHub Desktop.
wasted spacetime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @mixin | |
* Mixin static functionality to a magnet | |
**/ | |
define(function () { | |
return { | |
/** | |
* Get the visibility types for a magnet | |
* @return {object} an object with keys of types to their values | |
**/ | |
getVisibilityTypes: function () { | |
return { | |
'default': null, | |
'public': 'public', | |
'private': 'private' | |
}; | |
}, | |
/** | |
* Get the busy types for a magnet mapped to the value | |
* @return {Object} an object with the type / value mappings | |
**/ | |
getBusyTypes: function () { | |
return { | |
'busy': true, | |
'free': false | |
}; | |
} | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Tests for the static mixin | |
**/ | |
define([ | |
'app/models/magnet' | |
], function (Magnet) { | |
describe('app/models/magnet/staticMixin', function() { | |
describe('getVisibilityTypes', function() { | |
it('returns various types of visibility', function() { | |
expect(Magnet.getVisibilityTypes()).toEqual({ | |
'public': 'public', | |
'private': 'private', | |
'default': null | |
}); | |
}); | |
}); | |
describe('getBusyTypes', function () { | |
it('returns types of busy', function () { | |
expect(Magnet.getBusyTypes()).toEqual({ | |
'busy': true, | |
'free': false | |
}); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment