@@ -59,8 +59,8 @@ describe('FontStore', () => {
5959 const selected1 = await store . selectFont ( { fontFamily : 'Roboto' } ) ;
6060 const selected2 = await store . selectFont ( { fontFamily : 'Roboto Light' , fontStyle : 'italic' } ) ;
6161
62- expect ( selected1 . pdfFont . fontName ) . toBe ( 'Roboto' ) ;
63- expect ( selected2 . pdfFont . fontName ) . toBe ( 'Roboto Light Italic' ) ;
62+ expect ( selected1 . fontName ) . toBe ( 'Roboto' ) ;
63+ expect ( selected2 . fontName ) . toBe ( 'Roboto Light Italic' ) ;
6464 } ) ;
6565
6666 it ( 'registers font with custom config' , async ( ) => {
@@ -75,8 +75,8 @@ describe('FontStore', () => {
7575 const selected1 = await store . selectFont ( { fontFamily : 'Custom Name' } ) ;
7676 const selected2 = await store . selectFont ( { fontFamily : 'Custom Name' , fontWeight : 'bold' } ) ;
7777
78- expect ( selected1 . pdfFont . fontName ) . toBe ( 'Roboto Light Italic' ) ;
79- expect ( selected2 . pdfFont . fontName ) . toBe ( 'Roboto' ) ;
78+ expect ( selected1 . fontName ) . toBe ( 'Roboto Light Italic' ) ;
79+ expect ( selected2 . fontName ) . toBe ( 'Roboto' ) ;
8080 } ) ;
8181 } ) ;
8282
@@ -131,29 +131,29 @@ describe('FontStore', () => {
131131 const font3 = await store . selectFont ( { fontFamily, fontStyle : 'italic' } ) ;
132132 const font4 = await store . selectFont ( { fontFamily, fontStyle : 'italic' , fontWeight : 'bold' } ) ;
133133
134- expect ( font1 . pdfFont . fontName ) . toBe ( 'MockFont:Test:normal:400' ) ;
135- expect ( font2 . pdfFont . fontName ) . toBe ( 'MockFont:Test:normal:700' ) ;
136- expect ( font3 . pdfFont . fontName ) . toBe ( 'MockFont:Test:italic:400' ) ;
137- expect ( font4 . pdfFont . fontName ) . toBe ( 'MockFont:Test:italic:700' ) ;
134+ expect ( font1 . fontName ) . toBe ( 'MockFont:Test:normal:400' ) ;
135+ expect ( font2 . fontName ) . toBe ( 'MockFont:Test:normal:700' ) ;
136+ expect ( font3 . fontName ) . toBe ( 'MockFont:Test:italic:400' ) ;
137+ expect ( font4 . fontName ) . toBe ( 'MockFont:Test:italic:700' ) ;
138138 } ) ;
139139
140140 it ( 'selects first matching font if no family specified' , async ( ) => {
141141 const font1 = await store . selectFont ( { } ) ;
142- expect ( font1 . pdfFont . fontName ) . toBe ( 'MockFont:Test:normal:400' ) ;
142+ expect ( font1 . fontName ) . toBe ( 'MockFont:Test:normal:400' ) ;
143143
144144 const font2 = await store . selectFont ( { fontWeight : 'bold' } ) ;
145- expect ( font2 . pdfFont . fontName ) . toBe ( 'MockFont:Test:normal:700' ) ;
145+ expect ( font2 . fontName ) . toBe ( 'MockFont:Test:normal:700' ) ;
146146
147147 const font3 = await store . selectFont ( { fontStyle : 'italic' } ) ;
148- expect ( font3 . pdfFont . fontName ) . toBe ( 'MockFont:Test:italic:400' ) ;
148+ expect ( font3 . fontName ) . toBe ( 'MockFont:Test:italic:400' ) ;
149149
150150 const font4 = await store . selectFont ( { fontStyle : 'italic' , fontWeight : 'bold' } ) ;
151- expect ( font4 . pdfFont . fontName ) . toBe ( 'MockFont:Test:italic:700' ) ;
151+ expect ( font4 . fontName ) . toBe ( 'MockFont:Test:italic:700' ) ;
152152 } ) ;
153153
154154 it ( 'selects font with matching font family' , async ( ) => {
155155 await expect ( store . selectFont ( { fontFamily : 'Other' } ) ) . resolves . toEqual (
156- expect . objectContaining ( { name : 'MockFont:Other:normal:400' } ) ,
156+ expect . objectContaining ( { fontName : 'MockFont:Other:normal:400' } ) ,
157157 ) ;
158158 } ) ;
159159
@@ -165,7 +165,7 @@ describe('FontStore', () => {
165165 registerFakeFont ( store , 'Test' , { style : 'oblique' , weight : 700 } ) ;
166166
167167 await expect ( store . selectFont ( { fontFamily : 'Test' , fontStyle : 'italic' } ) ) . resolves . toEqual (
168- expect . objectContaining ( { name : 'MockFont:Test:oblique:400' } ) ,
168+ expect . objectContaining ( { fontName : 'MockFont:Test:oblique:400' } ) ,
169169 ) ;
170170 } ) ;
171171
@@ -178,17 +178,15 @@ describe('FontStore', () => {
178178
179179 const font = await store . selectFont ( { fontFamily : 'Test' , fontStyle : 'italic' } ) ;
180180
181- expect ( font . pdfFont ) . toEqual (
182- expect . objectContaining ( { fontName : 'MockFont:Test:italic:400' } ) ,
183- ) ;
181+ expect ( font ) . toEqual ( expect . objectContaining ( { fontName : 'MockFont:Test:italic:400' } ) ) ;
184182 } ) ;
185183
186184 it ( 'falls back when no matching font weight can be found' , async ( ) => {
187185 await expect ( store . selectFont ( { fontFamily : 'Other' , fontWeight : 'bold' } ) ) . resolves . toEqual (
188- expect . objectContaining ( { name : 'MockFont:Other:normal:400' } ) ,
186+ expect . objectContaining ( { fontName : 'MockFont:Other:normal:400' } ) ,
189187 ) ;
190188 await expect ( store . selectFont ( { fontFamily : 'Other' , fontWeight : 200 } ) ) . resolves . toEqual (
191- expect . objectContaining ( { name : 'MockFont:Other:normal:400' } ) ,
189+ expect . objectContaining ( { fontName : 'MockFont:Other:normal:400' } ) ,
192190 ) ;
193191 } ) ;
194192
0 commit comments