Skip to content

Commit

Permalink
Chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinwcyu committed Jul 9, 2024
1 parent c6de561 commit 2bbd47a
Show file tree
Hide file tree
Showing 6 changed files with 4,443 additions and 4,728 deletions.
90 changes: 35 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,82 +21,62 @@
"author": "Grafana",
"license": "Apache-2.0",
"dependencies": {
"@grafana/experimental": "1.7.3",
"react-use": "^15.3.4",
"tslib": "2.5.3",
"@emotion/css": "11.10.6",
"@grafana/data": "^10.4.0",
"@grafana/runtime": "^10.4.0",
"@grafana/ui": "^10.4.0",
"@grafana/schema": "^10.4.0",
"@grafana/data": "^10.4.5",
"@grafana/experimental": "1.7.12",
"@grafana/runtime": "^10.4.5",
"@grafana/schema": "^10.4.5",
"@grafana/ui": "^10.4.5",
"react": "18.2.0",
"react-dom": "18.2.0"
"react-dom": "18.2.0",
"tslib": "2.6.3"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@emotion/css": "^11.1.3",
"@grafana/aws-sdk": "0.4.0",
"@grafana/data": "9.3.2",
"@babel/core": "^7.24.7",
"@grafana/aws-sdk": "0.4.1",
"@grafana/eslint-config": "^7.0.0",
"@grafana/plugin-e2e": "^1.2.0",
"@grafana/runtime": "9.3.2",
"@grafana/tsconfig": "^1.2.0-rc1",
"@grafana/ui": "9.3.2",
"@playwright/test": "^1.41.2",
"@grafana/plugin-e2e": "^1.6.1",
"@grafana/tsconfig": "^1.3.0-rc1",
"@playwright/test": "^1.42.1",
"@swc/core": "^1.3.90",
"@swc/helpers": "^0.5.0",
"@swc/jest": "^0.2.26",
"@testing-library/jest-dom": "6.1.4",
"@testing-library/react": "14.0.0",
"@types/glob": "^8.0.0",
"@testing-library/dom": "^10.3.1",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "16.0.0",
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.0",
"@types/lodash": "^4.14.194",
"@types/lodash": "^4.17.6",
"@types/node": "^20.8.7",
"@types/prismjs": "1.16.0",
"@types/prismjs": "1.26.4",
"@types/react-router-dom": "^5.2.0",
"@types/slate": "0.47.1",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"copy-webpack-plugin": "^11.0.0",
"cspell": "8.0.0",
"css-loader": "^6.7.3",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jsdoc": "^46.7.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"copy-webpack-plugin": "^12.0.2",
"cspell": "^8.10.4",
"css-loader": "^7.1.2",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-webpack-plugin": "^4.0.1",
"fork-ts-checker-webpack-plugin": "9.0.2",
"glob": "^10.2.7",
"glob": "^11.0.0",
"identity-obj-proxy": "3.0.0",
"imports-loader": "^5.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom-sixteen": "^1.0.3",
"prettier": "^2.8.7",
"prismjs": "1.27.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^3.3.2",
"prismjs": "1.29.0",
"replace-in-file-webpack-plugin": "^1.0.6",
"rxjs": "7.5.7",
"sass": "1.63.2",
"sass-loader": "13.3.1",
"style-loader": "3.3.3",
"sass": "1.77.6",
"sass-loader": "14.2.1",
"style-loader": "4.0.0",
"swc-loader": "^0.2.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "4.8.4",
"typescript": "5.5.3",
"webpack": "^5.86.0",
"webpack-cli": "^5.1.4",
"webpack-livereload-plugin": "^3.0.2",
"@types/react-router-dom": "^5.2.0",
"@types/testing-library__jest-dom": "5.14.8",
"eslint-plugin-deprecation": "^2.0.0",
"imports-loader": "^5.0.0",
"jest-environment-jsdom": "^29.5.0"
"webpack-livereload-plugin": "^3.0.2"
},
"resolutions": {
"cosmiconfig": "8.3.6",
"debug": "2.6.9",
"d3-color": "3.1.0",
"underscore": "1.12.1"
"cosmiconfig": "8.3.6"
}
}
4 changes: 3 additions & 1 deletion src/DataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
TimeRange,
toDuration,
NodeGraphDataFrameFieldNames,
anyToNumber,
} from '@grafana/data';
import { DataSourceWithBackend, getTemplateSrv, TemplateSrv, config } from '@grafana/runtime';
import { Observable } from 'rxjs';
Expand Down Expand Up @@ -187,7 +188,8 @@ export class XrayDataSource extends DataSourceWithBackend<XrayQuery, XrayJsonDat

if (duration) {
duration.type = FieldType.string;
duration.display = (val) => {
duration.display = (rawVal) => {
const val = anyToNumber(rawVal);
const momentDuration = toDuration(val);
return {
numeric: val,
Expand Down
118 changes: 56 additions & 62 deletions src/components/QueryEditor/QueryEditor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('QueryEditor', () => {

it('inits the query with query type', async () => {
const { onChange } = await renderWithQuery({ query: '' });
expect(onChange).toBeCalledWith({
expect(onChange).toHaveBeenCalledWith({
refId: 'A',
query: '',
queryType: XrayQueryType.getTraceSummaries,
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('QueryEditor', () => {
let option = screen.getByText(/Success Count/i);
fireEvent.click(option);

expect(onChange).toBeCalledWith({
expect(onChange).toHaveBeenCalledWith({
refId: 'A',
query: '',
columns: ['OkCount'],
Expand All @@ -186,22 +186,20 @@ describe('QueryEditor', () => {
});

it('waits until groups and regions are loaded', async () => {
await act(async () => {
render(
<QueryEditor
{...{
...defaultProps,
query: {
refId: 'A',
} as any,
}}
onChange={() => {}}
/>
);
// No ideal selector but spinner does not seem to have any better thing to select by
expect(screen.getByText('', { selector: '.fa-spinner' })).toBeDefined();
await waitFor(() => expect(screen.getByText('Query')).toBeDefined());
});
render(
<QueryEditor
{...{
...defaultProps,
query: {
refId: 'A',
} as any,
}}
onChange={() => {}}
/>
);
// No ideal selector but spinner does not seem to have any better thing to select by
expect(screen.getByTestId('Spinner')).toBeDefined();
expect(await screen.findByText('Query')).toBeDefined();
});

it('sets the correct links based on region default', async () => {
Expand All @@ -222,54 +220,50 @@ describe('QueryEditor', () => {

it('shows the accountIds in a dropdown on service map selection', async () => {
const mockGetAccountIdsForServiceMap = jest.fn(() => Promise.resolve(['account1', 'account2']));
await act(async () => {
render(
<QueryEditor
{...{
...defaultProps,
datasource: {
...defaultProps.datasource,
getAccountIdsForServiceMap: mockGetAccountIdsForServiceMap,
},
query: {
refId: 'A',
queryType: 'getServiceMap',
accountIds: ['account1'],
} as any,
}}
onChange={() => {}}
/>
);
expect(screen.getByText('', { selector: '.fa-spinner' })).toBeDefined();
await waitFor(() => expect(screen.getByText('account1')).toBeDefined());
expect(mockGetAccountIdsForServiceMap).toHaveBeenCalled();
});
render(
<QueryEditor
{...{
...defaultProps,
datasource: {
...defaultProps.datasource,
getAccountIdsForServiceMap: mockGetAccountIdsForServiceMap,
},
query: {
refId: 'A',
queryType: 'getServiceMap',
accountIds: ['account1'],
} as any,
}}
onChange={() => {}}
/>
);
expect(screen.getByTestId('Spinner')).toBeDefined();
expect(await screen.findByText('account1')).toBeDefined();
expect(mockGetAccountIdsForServiceMap).toHaveBeenCalled();
});

it('does not fetch account ids if service map is not selected', async () => {
const mockGetAccountIdsForServiceMap = jest.fn(() => Promise.resolve(['account1', 'account2']));
await act(async () => {
render(
<QueryEditor
{...{
...defaultProps,
datasource: {
...defaultProps.datasource,
getAccountIdsForServiceMap: mockGetAccountIdsForServiceMap,
},
query: {
refId: 'A',
queryType: XrayQueryType.getTrace,
accountIds: [],
} as any,
}}
onChange={() => {}}
/>
);
expect(screen.getByText('', { selector: '.fa-spinner' })).toBeDefined();
await waitForElementToBeRemoved(() => screen.getByText('', { selector: '.fa-spinner' }));
expect(mockGetAccountIdsForServiceMap).not.toHaveBeenCalled();
});
render(
<QueryEditor
{...{
...defaultProps,
datasource: {
...defaultProps.datasource,
getAccountIdsForServiceMap: mockGetAccountIdsForServiceMap,
},
query: {
refId: 'A',
queryType: XrayQueryType.getTrace,
accountIds: [],
} as any,
}}
onChange={() => {}}
/>
);
expect(screen.getByTestId('Spinner')).toBeDefined();
await waitForElementToBeRemoved(() => screen.getByTestId('Spinner'));
expect(mockGetAccountIdsForServiceMap).not.toHaveBeenCalled();
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AwsAuthDataSourceJsonData } from '@grafana/aws-sdk';
import { DataQuery } from '@grafana/data';
import { DataQuery } from '@grafana/schema';

export type Group = {
FilterExpression?: string;
Expand Down
Loading

0 comments on commit 2bbd47a

Please sign in to comment.