@@ -10,7 +10,6 @@ import { MockAnnotationLineProps, MockAnnotationRectProps } from '../../../../mo
1010import { MockAnnotationSpec , MockGlobalSpec , MockSeriesSpec } from '../../../../mocks/specs' ;
1111import { MockStore } from '../../../../mocks/store' ;
1212import { ScaleType } from '../../../../scales/constants' ;
13- import { Position } from '../../../../utils/common' ;
1413import { AnnotationId } from '../../../../utils/ids' ;
1514import { DEFAULT_ANNOTATION_LINE_STYLE } from '../../../../utils/themes/merge_utils' ;
1615import { computeAnnotationDimensionsSelector } from '../../state/selectors/compute_annotations' ;
@@ -44,15 +43,11 @@ describe('Annotation utils', () => {
4443 ] ,
4544 } ) ;
4645
47- const verticalAxisSpec = MockGlobalSpec . axis ( {
48- id : 'vertical_axis' ,
46+ const defaultAxisSpec = {
4947 groupId,
50- hide : false ,
51- showOverlappingTicks : false ,
52- showOverlappingLabels : false ,
53- position : Position . Left ,
48+ hide : true ,
5449 showGridLines : true ,
55- } ) ;
50+ } ;
5651
5752 test ( 'should compute line annotation in x ordinal scale' , ( ) => {
5853 const store = MockStore . default ( ) ;
@@ -130,15 +125,7 @@ describe('Annotation utils', () => {
130125 } ) ;
131126
132127 MockStore . addSpecs (
133- [
134- settings ,
135- ordinalBarChart ,
136- lineAnnotation ,
137- MockGlobalSpec . axis ( {
138- ...verticalAxisSpec ,
139- hide : true ,
140- } ) ,
141- ] ,
128+ [ settings , ordinalBarChart , lineAnnotation , MockGlobalSpec . yAxis ( defaultAxisSpec , settings . rotation ) ] ,
142129 store ,
143130 ) ;
144131
@@ -173,16 +160,7 @@ describe('Annotation utils', () => {
173160 } ) ;
174161
175162 MockStore . addSpecs (
176- [
177- settings ,
178- ordinalBarChart ,
179- lineAnnotation ,
180- MockGlobalSpec . axis ( {
181- ...verticalAxisSpec ,
182- position : Position . Right ,
183- hide : true ,
184- } ) ,
185- ] ,
163+ [ settings , ordinalBarChart , lineAnnotation , MockGlobalSpec . yAxis ( defaultAxisSpec , settings . rotation ) ] ,
186164 store ,
187165 ) ;
188166
@@ -217,15 +195,7 @@ describe('Annotation utils', () => {
217195 } ) ;
218196
219197 MockStore . addSpecs (
220- [
221- settings ,
222- ordinalBarChart ,
223- lineAnnotation ,
224- MockGlobalSpec . axis ( {
225- ...verticalAxisSpec ,
226- hide : true ,
227- } ) ,
228- ] ,
198+ [ settings , ordinalBarChart , lineAnnotation , MockGlobalSpec . yAxis ( defaultAxisSpec , settings . rotation ) ] ,
229199 store ,
230200 ) ;
231201
@@ -263,8 +233,8 @@ describe('Annotation utils', () => {
263233 settings ,
264234 ordinalBarChart ,
265235 lineAnnotation ,
266- MockGlobalSpec . axis ( {
267- ...verticalAxisSpec ,
236+ MockGlobalSpec . yAxis ( {
237+ ...defaultAxisSpec ,
268238 hide : true ,
269239 } ) ,
270240 ] ,
@@ -289,16 +259,7 @@ describe('Annotation utils', () => {
289259 } ) ;
290260
291261 MockStore . addSpecs (
292- [
293- settings ,
294- ordinalBarChart ,
295- lineAnnotation ,
296- MockGlobalSpec . axis ( {
297- ...verticalAxisSpec ,
298- position : Position . Bottom ,
299- hide : true ,
300- } ) ,
301- ] ,
262+ [ settings , ordinalBarChart , lineAnnotation , MockGlobalSpec . xAxis ( defaultAxisSpec , settings . rotation ) ] ,
302263 store ,
303264 ) ;
304265
@@ -332,16 +293,7 @@ describe('Annotation utils', () => {
332293 } ) ;
333294
334295 MockStore . addSpecs (
335- [
336- settings ,
337- continuousBarChart ,
338- lineAnnotation ,
339- MockGlobalSpec . axis ( {
340- ...verticalAxisSpec ,
341- position : Position . Top ,
342- hide : true ,
343- } ) ,
344- ] ,
296+ [ settings , continuousBarChart , lineAnnotation , MockGlobalSpec . xAxis ( defaultAxisSpec , settings . rotation ) ] ,
345297 store ,
346298 ) ;
347299
@@ -374,16 +326,7 @@ describe('Annotation utils', () => {
374326 } ) ;
375327
376328 MockStore . addSpecs (
377- [
378- settings ,
379- continuousBarChart ,
380- lineAnnotation ,
381- MockGlobalSpec . axis ( {
382- ...verticalAxisSpec ,
383- position : Position . Bottom ,
384- hide : true ,
385- } ) ,
386- ] ,
329+ [ settings , continuousBarChart , lineAnnotation , MockGlobalSpec . xAxis ( defaultAxisSpec , settings . rotation ) ] ,
387330 store ,
388331 ) ;
389332
@@ -416,16 +359,7 @@ describe('Annotation utils', () => {
416359 } ) ;
417360
418361 MockStore . addSpecs (
419- [
420- settings ,
421- ordinalBarChart ,
422- lineAnnotation ,
423- MockGlobalSpec . axis ( {
424- ...verticalAxisSpec ,
425- position : Position . Top ,
426- hide : true ,
427- } ) ,
428- ] ,
362+ [ settings , ordinalBarChart , lineAnnotation , MockGlobalSpec . xAxis ( defaultAxisSpec , settings . rotation ) ] ,
429363 store ,
430364 ) ;
431365
@@ -459,16 +393,7 @@ describe('Annotation utils', () => {
459393 } ) ;
460394
461395 MockStore . addSpecs (
462- [
463- settings ,
464- continuousBarChart ,
465- lineAnnotation ,
466- MockGlobalSpec . axis ( {
467- ...verticalAxisSpec ,
468- position : Position . Top ,
469- hide : true ,
470- } ) ,
471- ] ,
396+ [ settings , continuousBarChart , lineAnnotation , MockGlobalSpec . xAxis ( defaultAxisSpec , settings . rotation ) ] ,
472397 store ,
473398 ) ;
474399
@@ -503,16 +428,7 @@ describe('Annotation utils', () => {
503428 } ) ;
504429
505430 MockStore . addSpecs (
506- [
507- settings ,
508- continuousBarChart ,
509- lineAnnotation ,
510- MockGlobalSpec . axis ( {
511- ...verticalAxisSpec ,
512- position : Position . Top ,
513- hide : true ,
514- } ) ,
515- ] ,
431+ [ settings , continuousBarChart , lineAnnotation , MockGlobalSpec . xAxis ( defaultAxisSpec , settings . rotation ) ] ,
516432 store ,
517433 ) ;
518434
@@ -546,16 +462,7 @@ describe('Annotation utils', () => {
546462 } ) ;
547463
548464 MockStore . addSpecs (
549- [
550- settings ,
551- continuousBarChart ,
552- lineAnnotation ,
553- MockGlobalSpec . axis ( {
554- ...verticalAxisSpec ,
555- position : Position . Top ,
556- hide : true ,
557- } ) ,
558- ] ,
465+ [ settings , continuousBarChart , lineAnnotation , MockGlobalSpec . xAxis ( defaultAxisSpec , settings . rotation ) ] ,
559466 store ,
560467 ) ;
561468
@@ -589,16 +496,7 @@ describe('Annotation utils', () => {
589496 } ) ;
590497
591498 MockStore . addSpecs (
592- [
593- settings ,
594- continuousBarChart ,
595- lineAnnotation ,
596- MockGlobalSpec . axis ( {
597- ...verticalAxisSpec ,
598- position : Position . Bottom ,
599- hide : true ,
600- } ) ,
601- ] ,
499+ [ settings , continuousBarChart , lineAnnotation , MockGlobalSpec . xAxis ( defaultAxisSpec , settings . rotation ) ] ,
602500 store ,
603501 ) ;
604502
0 commit comments