Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge "End to end tests" branch including react test harness and end-to-end playwright harness #50

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions dist/testables.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { MapCanvas } from './components/MapCanvas.component.js';
import { PubSub } from './components/lib/pubsub.js';
import { signals } from './signals.js';
import { CustomTextArea } from './components/CustomTextArea';
export { CustomTextArea };
export { MapCanvas };
export { PubSub };
export { signals };
//# sourceMappingURL=testables.d.ts.map
1 change: 1 addition & 0 deletions dist/testables.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions e2e/grafana-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ interface Dashboard {
* If one already exists for the given URL the fileId resolves to, the matching datasource is returned unless the
* forceCreate flag is set.
*
* @param {string | null} fileId
* @param {boolean} forceCreate
* @param {string} datasourceName The name for the new datasource
* @param {boolean} forceCreate Optional. Set to true to attempt to create a new datasource with a name duplicated by another datasource.
* @returns
*/
export const createDatasource = async (datasourceName, forceCreate = false): Promise<IDataSource> => {
Expand Down Expand Up @@ -73,8 +73,8 @@ export const createDatasource = async (datasourceName, forceCreate = false): Pro
}

/**
* Deletes a given datasource through its UID dsUid.
* @param {string} dsUid
* Deletes a given datasource through its datasource UID dsUid.
* @param {string} dsUid The datasource UID
*/
export const deleteDatasource = async (dsUid: string) => {
const { basicAuthHeader, protocolHostPort } = await getHostInfo(credentials);
Expand Down
2 changes: 1 addition & 1 deletion e2e/interfaces/TopologyEdge.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface ITopologyEdge {
name: string;
meta: {
endpoint_identifiers: {
pops: [string, string]
names: [string, string]
}
},
coordinates: [number, number, number];
Expand Down
8 changes: 5 additions & 3 deletions src/components/CustomTextArea.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react';

import { StandardEditorProps, StringFieldConfigSettings } from '@grafana/data';
import { StringFieldConfigSettings } from '@grafana/data/field/overrides/processors';
import { StandardEditorProps } from '@grafana/data';
sanchezelton marked this conversation as resolved.
Show resolved Hide resolved
import { monospacedFontSize } from '../options';

interface CustomTextAreaSettings extends StringFieldConfigSettings {
Expand Down Expand Up @@ -42,8 +43,9 @@ function validateMapJsonStr(inStr: string, currentValidationState: ValidationSta
const { name, meta, coordinates } = edge;
if (
!name || typeof(name) !== 'string' ||
(!!meta && typeof(meta) !== 'object') ||
meta?.endpoint_identifiers !== 'object' ||
!meta && typeof(meta) !== 'object' ||
!meta.endpoint_identifiers || typeof(meta.endpoint_identifiers) != 'object' ||
!Array.isArray(meta.endpoint_identifiers?.names) ||
!coordinates || !Array.isArray(coordinates) ||
coordinates.some((coordinate) => {
return !Array.isArray(coordinate)
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"sourceMap": true,
"outDir": "$$ts-jest$$"
},
"compileOnSave": true,
"exclude": ["public", "dist", "node_modules", "src/components/lib"]
}
Loading