spec/fontdeck/fontdeckscript_spec.js in webfontloader-1.4.0 vs spec/fontdeck/fontdeckscript_spec.js in webfontloader-1.4.1
- old
+ new
@@ -1,7 +1,8 @@
describe('FontdeckScript', function () {
- var FontdeckScript = webfont.FontdeckScript;
+ var FontdeckScript = webfont.FontdeckScript,
+ Font = webfont.Font;
var configuration = {
id: '2282'
};
@@ -81,13 +82,11 @@
});
it('should load correctly after calling the callback', function () {
global.__webfontfontdeckmodule__['2282'](true, apiResponse);
- expect(fontdeck.fontFamilies_).toEqual([apiResponse.fonts[0].name, apiResponse.fonts[1].name]);
- expect(fontdeck.fontVariations_[apiResponse.fonts[0].name]).toEqual(['n4']);
- expect(fontdeck.fontVariations_[apiResponse.fonts[1].name]).toEqual(['i7']);
+ expect(fontdeck.fonts_).toEqual([new Font(apiResponse.fonts[0].name), new Font(apiResponse.fonts[1].name, 'i7')]);
expect(support).toHaveBeenCalled();
});
});
@@ -101,11 +100,10 @@
fontdeck.supportUserAgent('user agent', support);
});
it('should not have loaded any fonts', function () {
- expect(fontdeck.fontFamilies_).toEqual([]);
- expect(fontdeck.fontVariations_).toEqual([]);
+ expect(fontdeck.fonts_).toEqual([]);
expect(support).toHaveBeenCalled();
});
});
});