@@ -3,49 +3,49 @@ import { suppressDebugConsole } from "@tests/vitest/helpers";
33import { beforeEach , describe , expect , test } from "vitest" ;
44
55import { getGalaxyInstance , setGalaxyInstance } from "@/app" ;
6+ import { GalaxyApp } from "@/app/galaxy" ;
67
78export function setupTestGalaxy ( galaxyOptions_ = null ) {
89 galaxyOptions_ = galaxyOptions_ || galaxyOptions ;
9- setGalaxyInstance ( ( GalaxyApp ) => new GalaxyApp ( galaxyOptions_ ) ) ;
10+ const app = new GalaxyApp ( galaxyOptions_ ) ;
11+ setGalaxyInstance ( app ) ;
1012}
1113
12- // the app console debugs make sense but we just don't want to see them in test
13- // output.
14+ // suppress console noise
1415suppressDebugConsole ( ) ;
1516
16- describe ( "App base construction/initializiation defaults" , ( ) => {
17+ describe ( "App base construction/initialization defaults" , ( ) => {
1718 beforeEach ( ( ) => {
1819 setupTestGalaxy ( galaxyOptions ) ;
1920 } ) ;
2021
21- test ( "App base construction/initializiation defaults" , function ( ) {
22+ test ( "App base construction/initialization defaults" , ( ) => {
2223 const app = getGalaxyInstance ( ) ;
2324 expect ( app . options && typeof app . options === "object" ) . toBeTruthy ( ) ;
2425 expect ( app . config && typeof app . config === "object" ) . toBeTruthy ( ) ;
2526 expect ( app . user && typeof app . config === "object" ) . toBeTruthy ( ) ;
2627 expect ( app . localize ) . toBe ( window . _l ) ;
2728 } ) ;
2829
29- test ( "App base default options" , function ( ) {
30+ test ( "App base default options" , ( ) => {
3031 const app = getGalaxyInstance ( ) ;
3132 expect ( app . options !== undefined && typeof app . options === "object" ) . toBeTruthy ( ) ;
3233 expect ( app . options . root ) . toBe ( "/" ) ;
3334 expect ( app . options . patchExisting ) . toBe ( true ) ;
3435 } ) ;
3536
36- // // We no longer want this behavior, but leaving the test to express that
37- test ( "App base will patch in attributes from existing Galaxy objects" , function ( ) {
37+ // we no longer patch attributes from existing Galaxy objects, test expresses that
38+ test ( "App base will patch in attributes from existing Galaxy objects" , ( ) => {
3839 const existingApp = getGalaxyInstance ( ) ;
3940 existingApp . foo = 123 ;
4041
41- const newApp = setGalaxyInstance ( ( GalaxyApp ) => {
42- return new GalaxyApp ( ) ;
43- } ) ;
42+ const newApp = new GalaxyApp ( ) ;
43+ setGalaxyInstance ( newApp ) ;
4444
45- expect ( newApp . foo === 123 ) . toBeTruthy ( ) ;
45+ expect ( newApp . foo ) . toBeUndefined ( ) ;
4646 } ) ;
4747
48- test ( "App base config" , function ( ) {
48+ test ( "App base config" , ( ) => {
4949 const app = getGalaxyInstance ( ) ;
5050 expect ( app . config && typeof app . config === "object" ) . toBeTruthy ( ) ;
5151 expect ( app . config . allow_user_deletion ) . toBe ( false ) ;
@@ -54,9 +54,9 @@ describe("App base construction/initializiation defaults", () => {
5454 expect ( app . config . ftp_upload_site ) . toBe ( null ) ;
5555 } ) ;
5656
57- test ( "App base user" , function ( ) {
57+ test ( "App base user" , ( ) => {
5858 const app = getGalaxyInstance ( ) ;
5959 expect ( app . user !== undefined && typeof app . user === "object" ) . toBeTruthy ( ) ;
60- expect ( app . user . isAdmin ( ) === false ) . toBeTruthy ( ) ;
60+ expect ( app . user . isAdmin ( ) ) . toBe ( false ) ;
6161 } ) ;
6262} ) ;
0 commit comments