@@ -59,54 +59,6 @@ func TestConvertDashboard(t *testing.T) {
5959 }, out .Permissions ["dashboard_my_dashboard" ])
6060}
6161
62- func TestConvertDashboardFilePath (t * testing.T ) {
63- src := resources.Dashboard {
64- FilePath : "some/path" ,
65- }
66-
67- vin , err := convert .FromTyped (src , dyn .NilValue )
68- require .NoError (t , err )
69-
70- ctx := context .Background ()
71- out := schema .NewResources ()
72- err = dashboardConverter {}.Convert (ctx , "my_dashboard" , vin , out )
73- require .NoError (t , err )
74-
75- // Assert that the "serialized_dashboard" is included.
76- assert .Subset (t , out .Dashboard ["my_dashboard" ], map [string ]any {
77- "serialized_dashboard" : "${file(\" some/path\" )}" ,
78- })
79-
80- // Assert that the "file_path" doesn't carry over.
81- assert .NotSubset (t , out .Dashboard ["my_dashboard" ], map [string ]any {
82- "file_path" : "some/path" ,
83- })
84- }
85-
86- func TestConvertDashboardFilePathQuoted (t * testing.T ) {
87- src := resources.Dashboard {
88- FilePath : `C:\foo\bar\baz\dashboard.lvdash.json` ,
89- }
90-
91- vin , err := convert .FromTyped (src , dyn .NilValue )
92- require .NoError (t , err )
93-
94- ctx := context .Background ()
95- out := schema .NewResources ()
96- err = dashboardConverter {}.Convert (ctx , "my_dashboard" , vin , out )
97- require .NoError (t , err )
98-
99- // Assert that the "serialized_dashboard" is included.
100- assert .Subset (t , out .Dashboard ["my_dashboard" ], map [string ]any {
101- "serialized_dashboard" : `${file("C:\\foo\\bar\\baz\\dashboard.lvdash.json")}` ,
102- })
103-
104- // Assert that the "file_path" doesn't carry over.
105- assert .NotSubset (t , out .Dashboard ["my_dashboard" ], map [string ]any {
106- "file_path" : `C:\foo\bar\baz\dashboard.lvdash.json` ,
107- })
108- }
109-
11062func TestConvertDashboardSerializedDashboardString (t * testing.T ) {
11163 src := resources.Dashboard {
11264 SerializedDashboard : `{ "json": true }` ,
0 commit comments