Sha256: e32792ed6dc09c209eeeaf13166587fdbb561ff7bde6f81ca97c1ac69ce48327
Contents?: true
Size: 1.87 KB
Versions: 13
Compression:
Stored size: 1.87 KB
Contents
describe('modules.Monotype', function () { var Monotype = webfont.modules.Monotype, Font = webfont.Font, BrowserInfo = webfont.BrowserInfo, UserAgent = webfont.UserAgent, Version = webfont.Version; var configuration = { projectId: '01e2ff27-25bf-4801-a23e-73d328e6c7cc', api: 'http://fast.fonts.net/jsapidev' }; var fakeDomHelper = null, global = null, script = {}, monotype = null, load = null, useragent = null, support = null; beforeEach(function () { global = {}; fakeDomHelper = { loadScript: jasmine.createSpy('loadScript').andCallFake(function (src, callback) { script.onload = callback; return script; }), getLoadWindow: jasmine.createSpy('getLoadWindow').andReturn(global), getProtocol: jasmine.createSpy('getProtocol').andReturn('http:') }; support = jasmine.createSpy('support'); load = jasmine.createSpy('load'); useragent = new UserAgent( 'Firefox', new Version(3, 6), 'Gecko', new Version(1, 9, 3), 'Macintosh', new Version(10, 6), undefined, new BrowserInfo(true, false, false, false) ); monotype = new Monotype(fakeDomHelper, configuration); monotype.supportUserAgent(useragent, support); monotype.load(load); global[Monotype.HOOK + configuration.projectId] = function () { return [{fontfamily: 'aachen bold'}, {fontfamily: 'kid print regular'}]; }; script.onload(); }); it('should create a script element', function () { expect(support).toHaveBeenCalled(); expect(fakeDomHelper.loadScript).toHaveBeenCalled(); expect(fakeDomHelper.loadScript.calls[0].args[0]).toEqual('http://fast.fonts.net/jsapidev/01e2ff27-25bf-4801-a23e-73d328e6c7cc.js'); expect(load).toHaveBeenCalledWith([new Font('aachen bold'), new Font('kid print regular')]); }); });
Version data entries
13 entries across 13 versions & 1 rubygems