@@ -100,15 +100,29 @@ test.describe('Configuration tests', () => {
100
100
*/
101
101
102
102
test ( '"Save & test" should fail when configuration is invalid' , async ( {
103
+ readProvisionedDataSource,
104
+ gotoDataSourceConfigPage,
105
+ } ) => {
106
+ const ds = await readProvisionedDataSource < DataSourcePluginOptionsEditorProps < PromOptions > > ( {
107
+ fileName : 'datasources.yml' ,
108
+ } ) ;
109
+ const configPage = await gotoDataSourceConfigPage ( ds . uid ) ;
110
+ await expect ( configPage . saveAndTest ( ) ) . not . toBeOK ( ) ;
111
+ await expect ( configPage ) . toHaveAlert ( 'error' , {
112
+ hasText : / .* t h e r e w a s a n e r r o r r e t u r n e d q u e r y i n g t h e p r o m e t h e u s a p i / i,
113
+ } ) ;
114
+ } ) ;
115
+
116
+ test ( '"Save & test" should fail when url is empty' , async ( {
103
117
createDataSourceConfigPage,
104
118
readProvisionedDataSource,
105
119
} ) => {
106
120
const ds = await readProvisionedDataSource < DataSourcePluginOptionsEditorProps < PromOptions > > ( {
107
121
fileName : 'datasources.yml' ,
108
122
} ) ;
109
123
const configPage = await createDataSourceConfigPage ( { type : ds . type } ) ;
110
- await expect ( configPage . saveAndTest ( ) ) . not . toBeOK ( ) ;
111
- await expect ( configPage ) . toHaveAlert ( 'error' , { hasText : 'empty url' } ) ;
124
+ await configPage . getByGrafanaSelector ( selectors . pages . DataSource . saveAndTest ) . click ( ) ;
125
+ await expect ( configPage ) . toHaveAlert ( 'error' , { hasText : / i n v a l i d U R L / i } ) ;
112
126
} ) ;
113
127
114
128
test ( 'it should allow a user to add the version when the Prom type is selected' , async ( {
0 commit comments