Sha256: e0624520464f5c78ab6151cf94529870a97c933b76d437b2b11eb60818114a79
Contents?: true
Size: 1.53 KB
Versions: 26
Compression:
Stored size: 1.53 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, 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'); monotype = new Monotype(fakeDomHelper, configuration); 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(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
26 entries across 26 versions & 1 rubygems