@@ -85,7 +85,7 @@ describe('annotator/config/settingsFrom', () => {
85
85
context (
86
86
'when the host page has a js-hypothesis-config with an annotations setting' ,
87
87
( ) => {
88
- beforeEach ( 'add a js-hypothesis-config annotations setting' , ( ) => {
88
+ beforeEach ( ( ) => {
89
89
fakeParseJsonConfig . returns ( {
90
90
annotations : 'annotationsFromJSON' ,
91
91
} ) ;
@@ -101,19 +101,16 @@ describe('annotator/config/settingsFrom', () => {
101
101
context (
102
102
"when there's also an `annotations` in the URL fragment" ,
103
103
( ) => {
104
- specify (
105
- 'js-hypothesis-config annotations override URL ones' ,
106
- ( ) => {
107
- const window_ = fakeWindow (
108
- 'http://localhost:3000#annotations:annotationsFromURL' ,
109
- ) ;
110
-
111
- assert . equal (
112
- settingsFrom ( window_ ) . annotations ,
113
- 'annotationsFromJSON' ,
114
- ) ;
115
- } ,
116
- ) ;
104
+ it ( 'overrides URLs with js-hypothesis-config annotations' , ( ) => {
105
+ const window_ = fakeWindow (
106
+ 'http://localhost:3000#annotations:annotationsFromURL' ,
107
+ ) ;
108
+
109
+ assert . equal (
110
+ settingsFrom ( window_ ) . annotations ,
111
+ 'annotationsFromJSON' ,
112
+ ) ;
113
+ } ) ;
117
114
} ,
118
115
) ;
119
116
} ,
@@ -183,7 +180,7 @@ describe('annotator/config/settingsFrom', () => {
183
180
context (
184
181
'when the host page has a js-hypothesis-config with a query setting' ,
185
182
( ) => {
186
- beforeEach ( 'add a js-hypothesis-config query setting' , ( ) => {
183
+ beforeEach ( ( ) => {
187
184
fakeParseJsonConfig . returns ( {
188
185
query : 'queryFromJSON' ,
189
186
} ) ;
@@ -194,7 +191,7 @@ describe('annotator/config/settingsFrom', () => {
194
191
} ) ;
195
192
196
193
context ( "when there's also a query in the URL fragment" , ( ) => {
197
- specify ( ' js-hypothesis-config queries override URL ones', ( ) => {
194
+ it ( 'overrides URL query with js-hypothesis-config ones', ( ) => {
198
195
const window_ = fakeWindow (
199
196
'http://localhost:3000#annotations:query:queryFromUrl' ,
200
197
) ;
@@ -338,54 +335,54 @@ describe('annotator/config/settingsFrom', () => {
338
335
[
339
336
{
340
337
when : 'the client is embedded in a web page' ,
341
- specify : 'it returns setting values from window.hypothesisConfig()' ,
338
+ title : 'returns setting values from window.hypothesisConfig()' ,
342
339
configFuncSettings : { foo : 'configFuncValue' } ,
343
340
jsonSettings : { foo : 'ignored' } , // hypothesisConfig() overrides js-hypothesis-config
344
341
expected : 'configFuncValue' ,
345
342
} ,
346
343
{
347
344
when : 'the client is embedded in a web page' ,
348
- specify :
349
- 'it ignores settings from js-hypothesis-config if `ignoreOtherConfiguration` is present' ,
345
+ title :
346
+ 'ignores settings from js-hypothesis-config if `ignoreOtherConfiguration` is present' ,
350
347
isBrowserExtension : false ,
351
348
configFuncSettings : { ignoreOtherConfiguration : '1' } ,
352
349
jsonSettings : { foo : 'ignored' } ,
353
350
expected : undefined ,
354
351
} ,
355
352
{
356
353
when : 'the client is embedded in a web page' ,
357
- specify : 'it returns setting values from js-hypothesis-config objects' ,
354
+ title : 'returns setting values from js-hypothesis-config objects' ,
358
355
configFuncSettings : { } ,
359
356
jsonSettings : { foo : 'jsonValue' } ,
360
357
expected : 'jsonValue' ,
361
358
} ,
362
359
{
363
360
when : 'the client is embedded in a web page' ,
364
- specify :
365
- 'hypothesisConfig() settings override js-hypothesis-config ones ' ,
361
+ title :
362
+ 'overrides js-hypothesis-config with hypothesisConfig() settings ' ,
366
363
configFuncSettings : { foo : 'configFuncValue' } ,
367
364
jsonSettings : { foo : 'jsonValue' } ,
368
365
expected : 'configFuncValue' ,
369
366
} ,
370
367
{
371
368
when : 'the client is embedded in a web page' ,
372
- specify :
373
- 'even a null from hypothesisConfig() overrides js-hypothesis-config ' ,
369
+ title :
370
+ 'overrides js-hypothesis-config even with null from hypothesisConfig()' ,
374
371
configFuncSettings : { foo : null } ,
375
372
jsonSettings : { foo : 'jsonValue' } ,
376
373
expected : null ,
377
374
} ,
378
375
{
379
376
when : 'the client is embedded in a web page' ,
380
- specify :
381
- 'even an undefined from hypothesisConfig() overrides js-hypothesis-config ' ,
377
+ title :
378
+ 'overrides js-hypothesis-config even with undefined from hypothesisConfig()' ,
382
379
configFuncSettings : { foo : undefined } ,
383
380
jsonSettings : { foo : 'jsonValue' } ,
384
381
expected : undefined ,
385
382
} ,
386
383
] . forEach ( test => {
387
384
context ( test . when , ( ) => {
388
- specify ( test . specify , ( ) => {
385
+ it ( test . title , ( ) => {
389
386
fakeConfigFuncSettingsFrom . returns ( test . configFuncSettings ) ;
390
387
fakeParseJsonConfig . returns ( test . jsonSettings ) ;
391
388
const settings = settingsFrom ( fakeWindow ( ) ) ;
0 commit comments