morphFactorySpec.js 843 B

123456789101112131415161718192021222324252627282930313233
  1. describe('Morph Factory', function(){
  2. var morphFactory;
  3. var elements = {
  4. wrapper: angular.element('<div />'),
  5. content: angular.element('<div />'),
  6. morphable: angular.element('<div />')
  7. };
  8. var settings = {
  9. MorphableBoundingRect: {top: 0, left: 0, width: 0, height: 0, },
  10. ContentBoundingRect: {top: 0, left: 0, width: 0, height: 0, }
  11. };
  12. beforeEach(module('morph'));
  13. beforeEach(function (){
  14. inject(function (Morph){
  15. morphFactory = Morph;
  16. });
  17. });
  18. it('should create a new Modal instance', function(){
  19. var modal = morphFactory('Modal', elements, settings);
  20. expect(modal.toggle).to.be.a('function');
  21. });
  22. it('should create a new Overlay instance', function(){
  23. var overlay = morphFactory('Overlay', elements, settings);
  24. expect(overlay.toggle).to.be.a('function');
  25. });
  26. });