Annotation query: Render query result in alert box (#83230)

* add alert to annotation result

* cleanup

* add tests

* more refactoring

* apply pr feedback

* change severity

* use toHaveAlert matcher
This commit is contained in:
Erik Sundell
2024-03-18 14:26:56 +01:00
committed by GitHub
parent 5b085976bf
commit ebcca97052
5 changed files with 187 additions and 65 deletions
@@ -37,7 +37,32 @@ export const successfulDataQuery = {
},
};
export const successfulAnnotationQuery = {
export const failedAnnotationQuery: object = {
results: {
Anno: {
error: 'Google API Error 400',
errorSource: '',
status: 500,
},
},
};
export const failedAnnotationQueryWithMultipleErrors: object = {
results: {
Anno1: {
error: 'Google API Error 400',
errorSource: '',
status: 400,
},
Anno2: {
error: 'Google API Error 401',
errorSource: '',
status: 401,
},
},
};
export const successfulAnnotationQueryWithData: object = {
results: {
Anno: {
status: 200,
@@ -75,3 +100,39 @@ export const successfulAnnotationQuery = {
},
},
};
export const successfulAnnotationQueryWithoutData: object = {
results: {
Anno: {
status: 200,
frames: [
{
schema: {
refId: 'Anno',
fields: [
{
name: 'time',
type: 'time',
typeInfo: {
frame: 'time.Time',
nullable: true,
},
},
{
name: 'col2',
type: 'string',
typeInfo: {
frame: 'string',
nullable: true,
},
},
],
},
data: {
values: [],
},
},
],
},
},
};