@@ -84,19 +84,34 @@ describe('Testing of the collection.tenants methods', () => {
84
84
85
85
describe ( 'getByName and getByNames' , ( ) => {
86
86
it ( 'should be able to get a tenant by name string' , async ( ) => {
87
- const result = await collection . tenants . getByName ( 'hot' ) ;
87
+ const query = ( ) => collection . tenants . getByName ( 'hot' ) ;
88
+ if ( await client . getWeaviateVersion ( ) . then ( ( ver ) => ver . isLowerThan ( 1 , 25 , 0 ) ) ) {
89
+ await expect ( query ( ) ) . rejects . toThrow ( WeaviateUnsupportedFeatureError ) ;
90
+ return ;
91
+ }
92
+ const result = await query ( ) ;
88
93
expect ( result ) . toHaveProperty ( 'name' , 'hot' ) ;
89
94
expect ( result ) . toHaveProperty ( 'activityStatus' , 'ACTIVE' ) ;
90
95
} ) ;
91
96
92
97
it ( 'should be able to get a tenant by tenant object' , async ( ) => {
93
- const result = await collection . tenants . getByName ( { name : 'hot' } ) ;
98
+ const query = ( ) => collection . tenants . getByName ( { name : 'hot' } ) ;
99
+ if ( await client . getWeaviateVersion ( ) . then ( ( ver ) => ver . isLowerThan ( 1 , 25 , 0 ) ) ) {
100
+ await expect ( query ( ) ) . rejects . toThrow ( WeaviateUnsupportedFeatureError ) ;
101
+ return ;
102
+ }
103
+ const result = await query ( ) ;
94
104
expect ( result ) . toHaveProperty ( 'name' , 'hot' ) ;
95
105
expect ( result ) . toHaveProperty ( 'activityStatus' , 'ACTIVE' ) ;
96
106
} ) ;
97
107
98
108
it ( 'should fail to get a non-existing tenant' , async ( ) => {
99
- const result = await collection . tenants . getByName ( 'non-existing' ) ;
109
+ const query = ( ) => collection . tenants . getByName ( 'non-existing' ) ;
110
+ if ( await client . getWeaviateVersion ( ) . then ( ( ver ) => ver . isLowerThan ( 1 , 25 , 0 ) ) ) {
111
+ await expect ( query ( ) ) . rejects . toThrow ( WeaviateUnsupportedFeatureError ) ;
112
+ return ;
113
+ }
114
+ const result = await query ( ) ;
100
115
expect ( result ) . toBeNull ( ) ;
101
116
} ) ;
102
117
0 commit comments