File tree Expand file tree Collapse file tree 2 files changed +0
-63
lines changed
Expand file tree Collapse file tree 2 files changed +0
-63
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,3 @@ export function tabForAnnotation(ann: Annotation): TabName {
1515 return 'annotation' ;
1616 }
1717}
18-
19- /**
20- * Return true if an annotation should be displayed in a given tab.
21- */
22- export function shouldShowInTab ( ann : Annotation , tab : TabName ) : boolean {
23- if ( metadata . isWaitingToAnchor ( ann ) ) {
24- // Until this annotation anchors or fails to anchor, we do not know which
25- // tab it should be displayed in.
26- return false ;
27- }
28- return tabForAnnotation ( ann ) === tab ;
29- }
Original file line number Diff line number Diff line change @@ -24,55 +24,4 @@ describe('sidebar/helpers/tabs', () => {
2424 } ) ;
2525 } ) ;
2626 } ) ;
27-
28- describe ( 'shouldShowInTab' , ( ) => {
29- [
30- {
31- // Anchoring in progress.
32- anchorTimeout : false ,
33- orphan : undefined ,
34- expectedTab : null ,
35- } ,
36- {
37- // Anchoring succeeded.
38- anchorTimeout : false ,
39- orphan : false ,
40- expectedTab : 'annotation' ,
41- } ,
42- {
43- // Anchoring failed.
44- anchorTimeout : false ,
45- orphan : true ,
46- expectedTab : 'orphan' ,
47- } ,
48- {
49- // Anchoring timed out.
50- anchorTimeout : true ,
51- orphan : undefined ,
52- expectedTab : 'annotation' ,
53- } ,
54- {
55- // Anchoring initially timed out but eventually
56- // failed.
57- anchorTimeout : true ,
58- orphan : true ,
59- expectedTab : 'orphan' ,
60- } ,
61- ] . forEach ( testCase => {
62- it ( 'returns true if the annotation should be shown' , ( ) => {
63- const ann = fixtures . defaultAnnotation ( ) ;
64- ann . $anchorTimeout = testCase . anchorTimeout ;
65- ann . $orphan = testCase . orphan ;
66-
67- assert . equal (
68- tabs . shouldShowInTab ( ann , 'annotation' ) ,
69- testCase . expectedTab === 'annotation' ,
70- ) ;
71- assert . equal (
72- tabs . shouldShowInTab ( ann , 'orphan' ) ,
73- testCase . expectedTab === 'orphan' ,
74- ) ;
75- } ) ;
76- } ) ;
77- } ) ;
7827} ) ;
You can’t perform that action at this time.
0 commit comments