@@ -8,9 +8,7 @@ import FileAnnotationList from "../FileAnnotationList";
8
8
import FileDetail from "../../../entity/FileDetail" ;
9
9
import ExecutionEnvServiceNoop from "../../../services/ExecutionEnvService/ExecutionEnvServiceNoop" ;
10
10
import { initialState } from "../../../state" ;
11
- import { TOP_LEVEL_FILE_ANNOTATIONS } from "../../../constants" ;
12
- import Annotation from "../../../entity/Annotation" ;
13
- import { AnnotationType } from "../../../entity/AnnotationFormatter" ;
11
+ import { Environment , TOP_LEVEL_FILE_ANNOTATIONS } from "../../../constants" ;
14
12
15
13
describe ( "<FileAnnotationList />" , ( ) => {
16
14
describe ( "file path representation" , ( ) => {
@@ -20,22 +18,14 @@ describe("<FileAnnotationList />", () => {
20
18
21
19
class FakeExecutionEnvService extends ExecutionEnvServiceNoop {
22
20
public formatPathForHost ( posixPath : string ) : Promise < string > {
23
- return Promise . resolve ( posixPath . replace ( "/allen " , hostMountPoint ) ) ;
21
+ return Promise . resolve ( posixPath . replace ( "/test " , hostMountPoint ) ) ;
24
22
}
25
23
}
26
24
27
25
const { store } = configureMockStore ( {
28
26
state : mergeState ( initialState , {
29
27
metadata : {
30
- annotations : [
31
- ...TOP_LEVEL_FILE_ANNOTATIONS ,
32
- new Annotation ( {
33
- annotationName : "Local File Path" ,
34
- annotationDisplayName : "File Path (Local VAST)" ,
35
- description : "Path to file in on-premises storage." ,
36
- type : AnnotationType . STRING ,
37
- } ) ,
38
- ] ,
28
+ annotations : [ ...TOP_LEVEL_FILE_ANNOTATIONS ] ,
39
29
} ,
40
30
interaction : {
41
31
platformDependentServices : {
@@ -45,18 +35,19 @@ describe("<FileAnnotationList />", () => {
45
35
} ) ,
46
36
} ) ;
47
37
48
- const filePathInsideAllenDrive = "path/to/MyFile.txt" ;
49
- const filePath = `production.files.allencell.org/${ filePathInsideAllenDrive } ` ;
50
- const fileDetails = new FileDetail ( {
51
- file_path : filePath ,
52
- file_id : "abc123" ,
53
- file_name : "MyFile.txt" ,
54
- file_size : 7 ,
55
- uploaded : "01/01/01" ,
56
- annotations : [
57
- { name : "Local File Path" , values : [ `/allen/${ filePathInsideAllenDrive } ` ] } ,
58
- ] ,
59
- } ) ;
38
+ const relativePath = "MyFile.txt" ;
39
+ const filePath = `test.files.allencell.org/${ relativePath } ` ;
40
+ const fileDetails = new FileDetail (
41
+ {
42
+ file_path : filePath ,
43
+ file_id : "c32e3eed66e4416d9532d369ffe1636f" ,
44
+ file_name : "MyFile.txt" ,
45
+ file_size : 7 ,
46
+ uploaded : "01/01/01" ,
47
+ annotations : [ { name : "Cache Eviction Date" , values : [ "SOME DATE" ] } ] ,
48
+ } ,
49
+ Environment . TEST
50
+ ) ;
60
51
61
52
// Act
62
53
const { findByText } = render (
@@ -70,7 +61,7 @@ describe("<FileAnnotationList />", () => {
70
61
"File Path (Cloud)" ,
71
62
`https://s3.us-west-2.amazonaws.com/${ filePath } ` ,
72
63
"File Path (Local VAST)" ,
73
- `${ hostMountPoint } /${ filePathInsideAllenDrive } ` ,
64
+ `${ hostMountPoint } /${ relativePath } ` ,
74
65
] ) {
75
66
expect ( await findByText ( cellText ) ) . to . not . be . undefined ;
76
67
}
@@ -98,15 +89,18 @@ describe("<FileAnnotationList />", () => {
98
89
} ) ;
99
90
100
91
const filePathInsideAllenDrive = "path/to/MyFile.txt" ;
101
- const filePath = `production.files.allencell.org/${ filePathInsideAllenDrive } ` ;
102
- const fileDetails = new FileDetail ( {
103
- file_path : filePath ,
104
- file_id : "abc123" ,
105
- file_name : "MyFile.txt" ,
106
- file_size : 7 ,
107
- uploaded : "01/01/01" ,
108
- annotations : [ ] ,
109
- } ) ;
92
+ const filePath = `test.files.allencell.org/${ filePathInsideAllenDrive } ` ;
93
+ const fileDetails = new FileDetail (
94
+ {
95
+ file_path : filePath ,
96
+ file_id : "abc123" ,
97
+ file_name : "MyFile.txt" ,
98
+ file_size : 7 ,
99
+ uploaded : "01/01/01" ,
100
+ annotations : [ ] ,
101
+ } ,
102
+ Environment . TEST
103
+ ) ;
110
104
111
105
// Act
112
106
const { getByText } = render (
@@ -144,14 +138,17 @@ describe("<FileAnnotationList />", () => {
144
138
} ) ,
145
139
} ) ;
146
140
147
- const fileDetails = new FileDetail ( {
148
- file_path : "path/to/file" ,
149
- file_id : "abc123" ,
150
- file_name : "MyFile.txt" ,
151
- file_size : 7 ,
152
- uploaded : "01/01/01" ,
153
- annotations : [ { name : "shouldBeInLocal" , values : [ true ] } ] ,
154
- } ) ;
141
+ const fileDetails = new FileDetail (
142
+ {
143
+ file_path : "path/to/file" ,
144
+ file_id : "abc123" ,
145
+ file_name : "MyFile.txt" ,
146
+ file_size : 7 ,
147
+ uploaded : "01/01/01" ,
148
+ annotations : [ { name : "shouldBeInLocal" , values : [ true ] } ] ,
149
+ } ,
150
+ Environment . TEST
151
+ ) ;
155
152
156
153
// Act
157
154
const { findByText } = render (
0 commit comments