@@ -11,11 +11,13 @@ describe("filebrowser", async () => {
11
11
12
12
testRequiredVariables ( import . meta. dir , {
13
13
agent_id : "foo" ,
14
+ agent_name : "main" ,
14
15
} ) ;
15
16
16
17
it ( "fails with wrong database_path" , async ( ) => {
17
18
const state = await runTerraformApply ( import . meta. dir , {
18
19
agent_id : "foo" ,
20
+ agent_name : "main" ,
19
21
database_path : "nofb" ,
20
22
} ) . catch ( ( e ) => {
21
23
if ( ! e . message . startsWith ( "\nError: Invalid value for variable" ) ) {
@@ -27,6 +29,7 @@ describe("filebrowser", async () => {
27
29
it ( "runs with default" , async ( ) => {
28
30
const state = await runTerraformApply ( import . meta. dir , {
29
31
agent_id : "foo" ,
32
+ agent_name : "main" ,
30
33
} ) ;
31
34
const output = await executeScriptInContainer ( state , "alpine" ) ;
32
35
expect ( output . exitCode ) . toBe ( 0 ) ;
@@ -48,6 +51,7 @@ describe("filebrowser", async () => {
48
51
it ( "runs with database_path var" , async ( ) => {
49
52
const state = await runTerraformApply ( import . meta. dir , {
50
53
agent_id : "foo" ,
54
+ agent_name : "main" ,
51
55
database_path : ".config/filebrowser.db" ,
52
56
} ) ;
53
57
const output = await executeScriptInContainer ( state , "alpine" ) ;
@@ -70,6 +74,7 @@ describe("filebrowser", async () => {
70
74
it ( "runs with folder var" , async ( ) => {
71
75
const state = await runTerraformApply ( import . meta. dir , {
72
76
agent_id : "foo" ,
77
+ agent_name : "main" ,
73
78
folder : "/home/coder/project" ,
74
79
} ) ;
75
80
const output = await executeScriptInContainer ( state , "alpine" ) ;
@@ -88,4 +93,27 @@ describe("filebrowser", async () => {
88
93
"📝 Logs at /tmp/filebrowser.log" ,
89
94
] ) ;
90
95
} ) ;
96
+
97
+ it ( "runs with subdomain=false" , async ( ) => {
98
+ const state = await runTerraformApply ( import . meta. dir , {
99
+ agent_id : "foo" ,
100
+ agent_name : "main" ,
101
+ subdomain : false ,
102
+ } ) ;
103
+ const output = await executeScriptInContainer ( state , "alpine" ) ;
104
+ expect ( output . exitCode ) . toBe ( 0 ) ;
105
+ expect ( output . stdout ) . toEqual ( [
106
+ "\u001B[0;1mInstalling filebrowser " ,
107
+ "" ,
108
+ "🥳 Installation complete! " ,
109
+ "" ,
110
+ "👷 Starting filebrowser in background... " ,
111
+ "" ,
112
+ "📂 Serving /root at http://localhost:13339 " ,
113
+ "" ,
114
+ "Running 'filebrowser --noauth --root /root --port 13339' " ,
115
+ "" ,
116
+ "📝 Logs at /tmp/filebrowser.log" ,
117
+ ] ) ;
118
+ } ) ;
91
119
} ) ;
0 commit comments