@perses-dev/plugin-system 0.23.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/model/calculations.js +6 -1
- package/dist/cjs/model/index.js +2 -2
- package/dist/cjs/runtime/time-series-queries.js +29 -6
- package/dist/model/calculations.d.ts +1 -1
- package/dist/model/calculations.d.ts.map +1 -1
- package/dist/model/calculations.js +7 -1
- package/dist/model/calculations.js.map +1 -1
- package/dist/model/datasource.d.ts +7 -0
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/index.d.ts +2 -2
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +2 -2
- package/dist/model/index.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +10 -4
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +13 -2
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +30 -6
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/package.json +5 -4
- package/dist/cjs/components/CalculationSelector/CalculationSelector.test.js +0 -65
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.test.js +0 -107
- package/dist/cjs/components/PluginEditor/PluginEditor.test.js +0 -150
- package/dist/cjs/components/PluginKindSelect.test.js +0 -86
- package/dist/cjs/components/PluginRegistry/PluginRegistry.test.js +0 -144
- package/dist/cjs/components/PluginSpecEditor.test.js +0 -92
- package/dist/components/CalculationSelector/CalculationSelector.test.d.ts +0 -2
- package/dist/components/CalculationSelector/CalculationSelector.test.d.ts.map +0 -1
- package/dist/components/CalculationSelector/CalculationSelector.test.js +0 -58
- package/dist/components/CalculationSelector/CalculationSelector.test.js.map +0 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.test.d.ts +0 -2
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.test.d.ts.map +0 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.test.js +0 -100
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.test.js.map +0 -1
- package/dist/components/PluginEditor/PluginEditor.test.d.ts +0 -2
- package/dist/components/PluginEditor/PluginEditor.test.d.ts.map +0 -1
- package/dist/components/PluginEditor/PluginEditor.test.js +0 -143
- package/dist/components/PluginEditor/PluginEditor.test.js.map +0 -1
- package/dist/components/PluginKindSelect.test.d.ts +0 -2
- package/dist/components/PluginKindSelect.test.d.ts.map +0 -1
- package/dist/components/PluginKindSelect.test.js +0 -79
- package/dist/components/PluginKindSelect.test.js.map +0 -1
- package/dist/components/PluginRegistry/PluginRegistry.test.d.ts +0 -2
- package/dist/components/PluginRegistry/PluginRegistry.test.d.ts.map +0 -1
- package/dist/components/PluginRegistry/PluginRegistry.test.js +0 -137
- package/dist/components/PluginRegistry/PluginRegistry.test.js.map +0 -1
- package/dist/components/PluginSpecEditor.test.d.ts +0 -2
- package/dist/components/PluginSpecEditor.test.d.ts.map +0 -1
- package/dist/components/PluginSpecEditor.test.js +0 -85
- package/dist/components/PluginSpecEditor.test.js.map +0 -1
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { screen, render, getAllByRole } from '@testing-library/react';
|
|
15
|
-
import userEvent from '@testing-library/user-event';
|
|
16
|
-
import { OptionsEditorTabs } from './OptionsEditorTabs';
|
|
17
|
-
describe('OptionsEditorTabs', ()=>{
|
|
18
|
-
const mockTabs = [
|
|
19
|
-
{
|
|
20
|
-
label: 'Query',
|
|
21
|
-
content: /*#__PURE__*/ _jsx("div", {
|
|
22
|
-
children: "Edit query configuration"
|
|
23
|
-
})
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
label: 'Settings',
|
|
27
|
-
content: /*#__PURE__*/ _jsx("div", {
|
|
28
|
-
children: "Edit settings configuration"
|
|
29
|
-
})
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: 'JSON',
|
|
33
|
-
content: /*#__PURE__*/ _jsx("div", {
|
|
34
|
-
children: "JSON editor"
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
];
|
|
38
|
-
const renderTabs = (otherTabs)=>{
|
|
39
|
-
const tabs = otherTabs !== null && otherTabs !== void 0 ? otherTabs : mockTabs;
|
|
40
|
-
render(/*#__PURE__*/ _jsx(OptionsEditorTabs, {
|
|
41
|
-
tabs: tabs
|
|
42
|
-
}));
|
|
43
|
-
};
|
|
44
|
-
it('renders all specified tabs in a tab list', ()=>{
|
|
45
|
-
renderTabs();
|
|
46
|
-
const tabList = screen.getByRole('tablist');
|
|
47
|
-
const tabs = getAllByRole(tabList, 'tab');
|
|
48
|
-
expect(tabs).toHaveLength(3);
|
|
49
|
-
expect(tabs[0]).toHaveTextContent('Query');
|
|
50
|
-
expect(tabs[1]).toHaveTextContent('Settings');
|
|
51
|
-
expect(tabs[2]).toHaveTextContent('JSON');
|
|
52
|
-
});
|
|
53
|
-
it('defaults to selecting the first tab', ()=>{
|
|
54
|
-
renderTabs();
|
|
55
|
-
const activeTab = screen.getByRole('tab', {
|
|
56
|
-
selected: true
|
|
57
|
-
});
|
|
58
|
-
expect(activeTab).toHaveTextContent('Query');
|
|
59
|
-
const activeTabPanel = screen.getByRole('tabpanel');
|
|
60
|
-
expect(activeTabPanel).toHaveTextContent('query configuration');
|
|
61
|
-
});
|
|
62
|
-
it('switches selected tab on click', ()=>{
|
|
63
|
-
renderTabs();
|
|
64
|
-
const jsonTab = screen.getByRole('tab', {
|
|
65
|
-
name: 'JSON'
|
|
66
|
-
});
|
|
67
|
-
userEvent.click(jsonTab);
|
|
68
|
-
const activeTab = screen.getByRole('tab', {
|
|
69
|
-
selected: true
|
|
70
|
-
});
|
|
71
|
-
expect(activeTab).toBe(jsonTab);
|
|
72
|
-
const activeTabPanel = screen.getByRole('tabpanel');
|
|
73
|
-
expect(activeTabPanel).toHaveTextContent('JSON editor');
|
|
74
|
-
});
|
|
75
|
-
it('switches selected tab on keyboard interactions', ()=>{
|
|
76
|
-
renderTabs();
|
|
77
|
-
const vizTab = screen.getByRole('tab', {
|
|
78
|
-
name: 'Settings'
|
|
79
|
-
});
|
|
80
|
-
userEvent.tab();
|
|
81
|
-
userEvent.keyboard('{arrowright}{space}');
|
|
82
|
-
const activeTab = screen.getByRole('tab', {
|
|
83
|
-
selected: true
|
|
84
|
-
});
|
|
85
|
-
expect(activeTab).toBe(vizTab);
|
|
86
|
-
const activeTabPanel = screen.getByRole('tabpanel');
|
|
87
|
-
expect(activeTabPanel).toHaveTextContent('settings configuration');
|
|
88
|
-
});
|
|
89
|
-
it('renders tabs in correct order', ()=>{
|
|
90
|
-
renderTabs();
|
|
91
|
-
const tabList = screen.getByRole('tablist');
|
|
92
|
-
const tabs = getAllByRole(tabList, 'tab');
|
|
93
|
-
expect(tabs).toHaveLength(3);
|
|
94
|
-
expect(tabs[0]).toHaveTextContent('Query');
|
|
95
|
-
expect(tabs[1]).toHaveTextContent('Settings');
|
|
96
|
-
expect(tabs[2]).toHaveTextContent('JSON');
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
//# sourceMappingURL=OptionsEditorTabs.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/OptionsEditorTabs/OptionsEditorTabs.test.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { screen, render, getAllByRole } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\n\nimport { OptionsEditorTabs, OptionsEditorTabsProps } from './OptionsEditorTabs';\n\ndescribe('OptionsEditorTabs', () => {\n const mockTabs: OptionsEditorTabsProps['tabs'] = [\n {\n label: 'Query',\n content: <div>Edit query configuration</div>,\n },\n {\n label: 'Settings',\n content: <div>Edit settings configuration</div>,\n },\n {\n label: 'JSON',\n content: <div>JSON editor</div>,\n },\n ];\n const renderTabs = (otherTabs?: OptionsEditorTabsProps['tabs']) => {\n const tabs = otherTabs ?? mockTabs;\n render(<OptionsEditorTabs tabs={tabs} />);\n };\n\n it('renders all specified tabs in a tab list', () => {\n renderTabs();\n\n const tabList = screen.getByRole('tablist');\n const tabs = getAllByRole(tabList, 'tab');\n expect(tabs).toHaveLength(3);\n expect(tabs[0]).toHaveTextContent('Query');\n expect(tabs[1]).toHaveTextContent('Settings');\n expect(tabs[2]).toHaveTextContent('JSON');\n });\n\n it('defaults to selecting the first tab', () => {\n renderTabs();\n\n const activeTab = screen.getByRole('tab', {\n selected: true,\n });\n expect(activeTab).toHaveTextContent('Query');\n\n const activeTabPanel = screen.getByRole('tabpanel');\n expect(activeTabPanel).toHaveTextContent('query configuration');\n });\n\n it('switches selected tab on click', () => {\n renderTabs();\n const jsonTab = screen.getByRole('tab', { name: 'JSON' });\n userEvent.click(jsonTab);\n\n const activeTab = screen.getByRole('tab', {\n selected: true,\n });\n expect(activeTab).toBe(jsonTab);\n\n const activeTabPanel = screen.getByRole('tabpanel');\n expect(activeTabPanel).toHaveTextContent('JSON editor');\n });\n\n it('switches selected tab on keyboard interactions', () => {\n renderTabs();\n const vizTab = screen.getByRole('tab', { name: 'Settings' });\n userEvent.tab();\n userEvent.keyboard('{arrowright}{space}');\n\n const activeTab = screen.getByRole('tab', {\n selected: true,\n });\n expect(activeTab).toBe(vizTab);\n\n const activeTabPanel = screen.getByRole('tabpanel');\n expect(activeTabPanel).toHaveTextContent('settings configuration');\n });\n\n it('renders tabs in correct order', () => {\n renderTabs();\n\n const tabList = screen.getByRole('tablist');\n const tabs = getAllByRole(tabList, 'tab');\n expect(tabs).toHaveLength(3);\n expect(tabs[0]).toHaveTextContent('Query');\n expect(tabs[1]).toHaveTextContent('Settings');\n expect(tabs[2]).toHaveTextContent('JSON');\n });\n});\n"],"names":["screen","render","getAllByRole","userEvent","OptionsEditorTabs","describe","mockTabs","label","content","div","renderTabs","otherTabs","tabs","it","tabList","getByRole","expect","toHaveLength","toHaveTextContent","activeTab","selected","activeTabPanel","jsonTab","name","click","toBe","vizTab","tab","keyboard"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,MAAM,EAAEC,MAAM,EAAEC,YAAY,QAAQ,wBAAwB,CAAC;AACtE,OAAOC,SAAS,MAAM,6BAA6B,CAAC;AAEpD,SAASC,iBAAiB,QAAgC,qBAAqB,CAAC;AAEhFC,QAAQ,CAAC,mBAAmB,EAAE,IAAM;IAClC,MAAMC,QAAQ,GAAmC;QAC/C;YACEC,KAAK,EAAE,OAAO;YACdC,OAAO,gBAAE,KAACC,KAAG;0BAAC,0BAAwB;cAAM;SAC7C;QACD;YACEF,KAAK,EAAE,UAAU;YACjBC,OAAO,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iB,CAAC,wBAAwB,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEHL,EAAE,CAAC,+BAA+B,EAAE,IAAM;QACxCH,UAAU,EAAE,CAAC;QAEb,MAAMI,OAAO,GAAGd,MAAM,CAACe,SAAS,CAAC,SAAS,CAAC,AAAC;QAC5C,MAAMH,IAAI,GAAGV,YAAY,CAACY,OAAO,EAAE,KAAK,CAAC,AAAC;QAC1CE,MAAM,CAACJ,IAAI,CAAC,CAACK,YAAY,CAAC,CAAC,CAAC,CAAC;QAC7BD,MAAM,CAACJ,IAAI,CAAC,CAAC,CAAC,CAAC,CAACM,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3CF,MAAM,CAACJ,IAAI,CAAC,CAAC,CAAC,CAAC,CAACM,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC9CF,MAAM,CAACJ,IAAI,CAAC,CAAC,CAAC,CAAC,CAACM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginEditor.test.d.ts","sourceRoot":"","sources":["../../../src/components/PluginEditor/PluginEditor.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import userEvent from '@testing-library/user-event';
|
|
15
|
-
import { screen, waitFor } from '@testing-library/react';
|
|
16
|
-
import { useState } from 'react';
|
|
17
|
-
import { renderWithContext } from '../../test';
|
|
18
|
-
import { PluginEditor } from './PluginEditor';
|
|
19
|
-
describe('PluginEditor', ()=>{
|
|
20
|
-
const renderComponent = ({ pluginType ='Panel' , defaultPluginKinds , value } = {})=>{
|
|
21
|
-
const testValue = value || {
|
|
22
|
-
kind: 'BertPanel1',
|
|
23
|
-
spec: {
|
|
24
|
-
option1: 'Option1Value'
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
// A test helper component that includes the state that's controlled from outside
|
|
28
|
-
let onChange = jest.fn();
|
|
29
|
-
function TestHelperForm() {
|
|
30
|
-
const [value, setValue] = useState(testValue);
|
|
31
|
-
onChange = jest.fn((v)=>setValue(v));
|
|
32
|
-
return /*#__PURE__*/ _jsx(PluginEditor, {
|
|
33
|
-
pluginType: pluginType,
|
|
34
|
-
pluginKindLabel: "Panel Type",
|
|
35
|
-
value: value,
|
|
36
|
-
onChange: onChange
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
renderWithContext(/*#__PURE__*/ _jsx(TestHelperForm, {}), undefined, {
|
|
40
|
-
defaultPluginKinds
|
|
41
|
-
});
|
|
42
|
-
return {
|
|
43
|
-
onChange
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
// Opens the PluginKindSelect and waits for loading to finish (i.e. options to appear)
|
|
47
|
-
const openPluginKind = async ()=>{
|
|
48
|
-
const select = screen.getByRole('button', {
|
|
49
|
-
name: 'Panel Type'
|
|
50
|
-
});
|
|
51
|
-
userEvent.click(select);
|
|
52
|
-
const options = await screen.findAllByRole('option');
|
|
53
|
-
return options;
|
|
54
|
-
};
|
|
55
|
-
it('shows plugin kind and spec editor', async ()=>{
|
|
56
|
-
renderComponent();
|
|
57
|
-
const pluginKind = screen.getByRole('button', {
|
|
58
|
-
name: 'Panel Type'
|
|
59
|
-
});
|
|
60
|
-
await waitFor(()=>expect(pluginKind).toHaveTextContent('Bert Panel 1'));
|
|
61
|
-
const specEditor = await screen.findByLabelText('BertPanel1 editor');
|
|
62
|
-
expect(specEditor).toHaveValue('Option1Value');
|
|
63
|
-
});
|
|
64
|
-
it('initializes kind and spec together', async ()=>{
|
|
65
|
-
const { onChange } = renderComponent();
|
|
66
|
-
// Switch to a new plugin kind
|
|
67
|
-
await openPluginKind();
|
|
68
|
-
const newPluginKind = screen.getByRole('option', {
|
|
69
|
-
name: 'Bert Panel 2'
|
|
70
|
-
});
|
|
71
|
-
userEvent.click(newPluginKind);
|
|
72
|
-
// Wait for the editor of the other plugin
|
|
73
|
-
const newEditor = await screen.findByLabelText('BertPanel2 editor');
|
|
74
|
-
expect(newEditor).toBeInTheDocument();
|
|
75
|
-
expect(newEditor).toHaveValue('');
|
|
76
|
-
// Make sure onChange was only called once (i.e. initializes both kind and spec at the same time
|
|
77
|
-
expect(onChange).toHaveBeenCalledTimes(1);
|
|
78
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
79
|
-
kind: 'BertPanel2',
|
|
80
|
-
spec: {
|
|
81
|
-
option2: ''
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
it('remembers previous spec values', async ()=>{
|
|
86
|
-
renderComponent();
|
|
87
|
-
// Use the current editor to make a change to the spec value
|
|
88
|
-
let editor = await screen.findByLabelText('BertPanel1 editor');
|
|
89
|
-
userEvent.clear(editor);
|
|
90
|
-
userEvent.type(editor, 'MyNewValue');
|
|
91
|
-
// Switch to a new plugin kind
|
|
92
|
-
await openPluginKind();
|
|
93
|
-
const newPluginKind = screen.getByRole('option', {
|
|
94
|
-
name: 'Bert Panel 2'
|
|
95
|
-
});
|
|
96
|
-
userEvent.click(newPluginKind);
|
|
97
|
-
// Wait for the other editor to appear, then switch back
|
|
98
|
-
const newEditor = await screen.findByLabelText('BertPanel2 editor');
|
|
99
|
-
expect(newEditor).toHaveValue('');
|
|
100
|
-
await openPluginKind();
|
|
101
|
-
const oldPluginKind = screen.getByRole('option', {
|
|
102
|
-
name: 'Bert Panel 1'
|
|
103
|
-
});
|
|
104
|
-
userEvent.click(oldPluginKind);
|
|
105
|
-
// Make sure the editor from the first plugin appears and has our modified value from before the switch
|
|
106
|
-
editor = await screen.findByLabelText('BertPanel1 editor');
|
|
107
|
-
expect(editor).toHaveValue('MyNewValue');
|
|
108
|
-
});
|
|
109
|
-
describe('when defaultPluginKinds specified in plugin registry', ()=>{
|
|
110
|
-
it('uses default kind when one is not provided', async ()=>{
|
|
111
|
-
renderComponent({
|
|
112
|
-
pluginType: 'Panel',
|
|
113
|
-
defaultPluginKinds: {
|
|
114
|
-
Panel: 'BertPanel2'
|
|
115
|
-
},
|
|
116
|
-
value: {
|
|
117
|
-
kind: '',
|
|
118
|
-
spec: {}
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
// Wait for default panel kind to load.
|
|
122
|
-
const pluginKind = screen.getByRole('button', {
|
|
123
|
-
name: 'Panel Type'
|
|
124
|
-
});
|
|
125
|
-
await waitFor(()=>expect(pluginKind).toHaveTextContent('Bert Panel 2'));
|
|
126
|
-
});
|
|
127
|
-
it('does not use default when kind is provided', async ()=>{
|
|
128
|
-
renderComponent({
|
|
129
|
-
pluginType: 'Panel',
|
|
130
|
-
defaultPluginKinds: {
|
|
131
|
-
Panel: 'BertPanel2'
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
// Wait for specified panel kind to load.
|
|
135
|
-
const pluginKind = screen.getByRole('button', {
|
|
136
|
-
name: 'Panel Type'
|
|
137
|
-
});
|
|
138
|
-
await waitFor(()=>expect(pluginKind).toHaveTextContent('Bert Panel 1'));
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
//# sourceMappingURL=PluginEditor.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PluginEditor/PluginEditor.test.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport userEvent from '@testing-library/user-event';\nimport { screen, waitFor } from '@testing-library/react';\nimport { useState } from 'react';\nimport { renderWithContext } from '../../test';\nimport { DefaultPluginKinds } from '../../model';\nimport { PluginEditor } from './PluginEditor';\nimport { PluginEditorProps } from './plugin-editor-api';\n\ntype RenderComponentOptions = {\n pluginType?: PluginEditorProps['pluginType'];\n defaultPluginKinds?: DefaultPluginKinds;\n value?: PluginEditorProps['value'];\n};\n\ndescribe('PluginEditor', () => {\n const renderComponent = ({ pluginType = 'Panel', defaultPluginKinds, value }: RenderComponentOptions = {}) => {\n const testValue: PluginEditorProps['value'] = value || { kind: 'BertPanel1', spec: { option1: 'Option1Value' } };\n\n // A test helper component that includes the state that's controlled from outside\n let onChange: jest.Mocked<PluginEditorProps['onChange']> = jest.fn();\n function TestHelperForm() {\n const [value, setValue] = useState(testValue);\n onChange = jest.fn((v) => setValue(v));\n\n return <PluginEditor pluginType={pluginType} pluginKindLabel=\"Panel Type\" value={value} onChange={onChange} />;\n }\n\n renderWithContext(<TestHelperForm />, undefined, { defaultPluginKinds });\n return { onChange };\n };\n\n // Opens the PluginKindSelect and waits for loading to finish (i.e. options to appear)\n const openPluginKind = async () => {\n const select = screen.getByRole('button', { name: 'Panel Type' });\n userEvent.click(select);\n const options = await screen.findAllByRole('option');\n return options;\n };\n\n it('shows plugin kind and spec editor', async () => {\n renderComponent();\n\n const pluginKind = screen.getByRole('button', { name: 'Panel Type' });\n await waitFor(() => expect(pluginKind).toHaveTextContent('Bert Panel 1'));\n const specEditor = await screen.findByLabelText('BertPanel1 editor');\n expect(specEditor).toHaveValue('Option1Value');\n });\n\n it('initializes kind and spec together', async () => {\n const { onChange } = renderComponent();\n\n // Switch to a new plugin kind\n await openPluginKind();\n const newPluginKind = screen.getByRole('option', { name: 'Bert Panel 2' });\n userEvent.click(newPluginKind);\n\n // Wait for the editor of the other plugin\n const newEditor = await screen.findByLabelText('BertPanel2 editor');\n expect(newEditor).toBeInTheDocument();\n expect(newEditor).toHaveValue('');\n\n // Make sure onChange was only called once (i.e. initializes both kind and spec at the same time\n expect(onChange).toHaveBeenCalledTimes(1);\n expect(onChange).toHaveBeenCalledWith({ kind: 'BertPanel2', spec: { option2: '' } });\n });\n\n it('remembers previous spec values', async () => {\n renderComponent();\n\n // Use the current editor to make a change to the spec value\n let editor = await screen.findByLabelText('BertPanel1 editor');\n userEvent.clear(editor);\n userEvent.type(editor, 'MyNewValue');\n\n // Switch to a new plugin kind\n await openPluginKind();\n const newPluginKind = screen.getByRole('option', { name: 'Bert Panel 2' });\n userEvent.click(newPluginKind);\n\n // Wait for the other editor to appear, then switch back\n const newEditor = await screen.findByLabelText('BertPanel2 editor');\n expect(newEditor).toHaveValue('');\n await openPluginKind();\n const oldPluginKind = screen.getByRole('option', { name: 'Bert Panel 1' });\n userEvent.click(oldPluginKind);\n\n // Make sure the editor from the first plugin appears and has our modified value from before the switch\n editor = await screen.findByLabelText('BertPanel1 editor');\n expect(editor).toHaveValue('MyNewValue');\n });\n\n describe('when defaultPluginKinds specified in plugin registry', () => {\n it('uses default kind when one is not provided', async () => {\n renderComponent({\n pluginType: 'Panel',\n defaultPluginKinds: {\n Panel: 'BertPanel2',\n },\n value: { kind: '', spec: {} },\n });\n\n // Wait for default panel kind to load.\n const pluginKind = screen.getByRole('button', { name: 'Panel Type' });\n await waitFor(() => expect(pluginKind).toHaveTextContent('Bert Panel 2'));\n });\n\n it('does not use default when kind is provided', async () => {\n renderComponent({ pluginType: 'Panel', defaultPluginKinds: { Panel: 'BertPanel2' } });\n\n // Wait for specified panel kind to load.\n const pluginKind = screen.getByRole('button', { name: 'Panel Type' });\n await waitFor(() => expect(pluginKind).toHaveTextContent('Bert Panel 1'));\n });\n });\n});\n"],"names":["userEvent","screen","waitFor","useState","renderWithContext","PluginEditor","describe","renderComponent","pluginType","defaultPluginKinds","value","testValue","kind","spec","option1","onChange","jest","fn","TestHelperForm","setValue","v","pluginKindLabel","undefined","openPluginKind","select","getByRole","name","click","options","findAllByRole","it","pluginKind","expect","toHaveTextContent","specEditor","findByLabelText","toHaveValue","newPluginKind","newEditor","toBeInTheDocument","toHaveBeenCalledTimes","toHaveBeenCalledWith","option2","editor","clear","type","oldPluginKind","Panel"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,OAAOA,SAAS,MAAM,6BAA6B,CAAC;AACpD,SAASC,MAAM,EAAEC,OAAO,QAAQ,wBAAwB,CAAC;AACzD,SAASC,QAAQ,QAAQ,OAAO,CAAC;AACjC,SAASC,iBAAiB,QAAQ,YAAY,CAAC;AAE/C,SAASC,YAAY,QAAQ,gBAAgB,CAAC;AAS9CC,QAAQ,CAAC,cAAc,EAAE,IAAM;IAC7B,MAAMC,eAAe,GAAG,CAAC,EAAEC,UAAU,EAAG,OAAO,CAAA,EAAEC,kBAAkB,CAAA,EAAEC,KAAK,CAAA,EAA0B,GAAG,EAAE,GAAK;QAC5G,MAAMC,SAAS,GAA+BD,KAAK,IAAI;YAAEE,IAAI,EAAE,YAAY;YAAEC,IAAI,EAAE;gBAAEC,OAAO,EAAE,cAAc;aAAE;SAAE,AAAC;QAEjH,iFAAiF;QACjF,IAAIC,QAAQ,GAA+CC,IAAI,CAACC,EAAE,EAAE,AAAC;QACrE,SAASC,cAAc,GAA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C,EAAE,UAAY;YAC3DvB,eAAe,CAAC;gBAAEC,UAAU,EAAE,OAAO;gBAAEC,kBAAkB,EAAE;oBAAEsC,KAAK,EAAE,YAAY;iBAAE;aAAE,CAAC,CAAC;YAEtF,yCAAyC;YACzC,MAAMhB,UAAU,GAAG9B,MAAM,CAACwB,SAAS,CAAC,QAAQ,EAAE;gBAAEC,IAAI,EAAE,YAAY;aAAE,CAAC,AAAC;YACtE,MAAMxB,OAAO,CAAC,IAAM8B,MAAM,CAACD,UAAU,CAAC,CAACE,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginKindSelect.test.d.ts","sourceRoot":"","sources":["../../src/components/PluginKindSelect.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import userEvent from '@testing-library/user-event';
|
|
15
|
-
import { screen } from '@testing-library/react';
|
|
16
|
-
import { renderWithContext } from '../test';
|
|
17
|
-
import { PluginKindSelect } from './PluginKindSelect';
|
|
18
|
-
describe('PluginKindSelect', ()=>{
|
|
19
|
-
const renderComponent = (props)=>{
|
|
20
|
-
return renderWithContext(/*#__PURE__*/ _jsx(PluginKindSelect, {
|
|
21
|
-
...props
|
|
22
|
-
}));
|
|
23
|
-
};
|
|
24
|
-
// Opens the select and waits for loading to finish (i.e. options to appear)
|
|
25
|
-
const openSelect = async ()=>{
|
|
26
|
-
const select = screen.getByRole('button');
|
|
27
|
-
userEvent.click(select);
|
|
28
|
-
const options = await screen.findAllByRole('option');
|
|
29
|
-
return options;
|
|
30
|
-
};
|
|
31
|
-
it('displays the list of plugins for a plugin type', async ()=>{
|
|
32
|
-
renderComponent({
|
|
33
|
-
pluginType: 'Panel',
|
|
34
|
-
value: ''
|
|
35
|
-
});
|
|
36
|
-
// Open the select and verify the list of options from the test plugin data
|
|
37
|
-
const options = await openSelect();
|
|
38
|
-
expect(options).toHaveLength(2);
|
|
39
|
-
let option = screen.queryByRole('option', {
|
|
40
|
-
name: 'Bert Panel 1'
|
|
41
|
-
});
|
|
42
|
-
expect(option).toBeInTheDocument();
|
|
43
|
-
option = screen.queryByRole('option', {
|
|
44
|
-
name: 'Bert Panel 2'
|
|
45
|
-
});
|
|
46
|
-
expect(option).toBeInTheDocument();
|
|
47
|
-
});
|
|
48
|
-
it('shows the correct selected value', async ()=>{
|
|
49
|
-
renderComponent({
|
|
50
|
-
pluginType: 'Variable',
|
|
51
|
-
value: 'ErnieVariable'
|
|
52
|
-
});
|
|
53
|
-
// Use findByRole to wait for loading to finish and selected value to appear
|
|
54
|
-
const select = await screen.findByRole('button', {
|
|
55
|
-
name: 'Ernie Variable'
|
|
56
|
-
});
|
|
57
|
-
expect(select).toBeInTheDocument();
|
|
58
|
-
});
|
|
59
|
-
it('can select new value', async ()=>{
|
|
60
|
-
let onChangeValue = undefined;
|
|
61
|
-
const onChange = jest.fn((e)=>{
|
|
62
|
-
onChangeValue = e.target.value;
|
|
63
|
-
});
|
|
64
|
-
renderComponent({
|
|
65
|
-
pluginType: 'Variable',
|
|
66
|
-
value: 'ErnieVariable',
|
|
67
|
-
onChange
|
|
68
|
-
});
|
|
69
|
-
await openSelect();
|
|
70
|
-
const newOption = screen.getByRole('option', {
|
|
71
|
-
name: 'Bert Variable'
|
|
72
|
-
});
|
|
73
|
-
userEvent.click(newOption);
|
|
74
|
-
expect(onChange).toHaveBeenCalledTimes(1);
|
|
75
|
-
expect(onChangeValue).toBe('BertVariable');
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
//# sourceMappingURL=PluginKindSelect.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/PluginKindSelect.test.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport userEvent from '@testing-library/user-event';\nimport { screen } from '@testing-library/react';\nimport { renderWithContext } from '../test';\nimport { PluginKindSelect, PluginKindSelectProps } from './PluginKindSelect';\n\ndescribe('PluginKindSelect', () => {\n const renderComponent = (props: PluginKindSelectProps) => {\n return renderWithContext(<PluginKindSelect {...props} />);\n };\n\n // Opens the select and waits for loading to finish (i.e. options to appear)\n const openSelect = async () => {\n const select = screen.getByRole('button');\n userEvent.click(select);\n const options = await screen.findAllByRole('option');\n return options;\n };\n\n it('displays the list of plugins for a plugin type', async () => {\n renderComponent({\n pluginType: 'Panel',\n value: '',\n });\n\n // Open the select and verify the list of options from the test plugin data\n const options = await openSelect();\n expect(options).toHaveLength(2);\n\n let option = screen.queryByRole('option', { name: 'Bert Panel 1' });\n expect(option).toBeInTheDocument();\n option = screen.queryByRole('option', { name: 'Bert Panel 2' });\n expect(option).toBeInTheDocument();\n });\n\n it('shows the correct selected value', async () => {\n renderComponent({\n pluginType: 'Variable',\n value: 'ErnieVariable',\n });\n\n // Use findByRole to wait for loading to finish and selected value to appear\n const select = await screen.findByRole('button', { name: 'Ernie Variable' });\n expect(select).toBeInTheDocument();\n });\n\n it('can select new value', async () => {\n let onChangeValue: string | undefined = undefined;\n const onChange = jest.fn((e) => {\n onChangeValue = e.target.value;\n });\n renderComponent({\n pluginType: 'Variable',\n value: 'ErnieVariable',\n onChange,\n });\n\n await openSelect();\n const newOption = screen.getByRole('option', { name: 'Bert Variable' });\n userEvent.click(newOption);\n\n expect(onChange).toHaveBeenCalledTimes(1);\n expect(onChangeValue).toBe('BertVariable');\n });\n});\n"],"names":["userEvent","screen","renderWithContext","PluginKindSelect","describe","renderComponent","props","openSelect","select","getByRole","click","options","findAllByRole","it","pluginType","value","expect","toHaveLength","option","queryByRole","name","toBeInTheDocument","findByRole","onChangeValue","undefined","onChange","jest","fn","e","target","newOption","toHaveBeenCalledTimes","toBe"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,OAAOA,SAAS,MAAM,6BAA6B,CAAC;AACpD,SAASC,MAAM,QAAQ,wBAAwB,CAAC;AAChD,SAASC,iBAAiB,QAAQ,SAAS,CAAC;AAC5C,SAASC,gBAAgB,QAA+B,oBAAoB,CAAC;AAE7EC,QAAQ,CAAC,kBAAkB,EAAE,IAAM;IACjC,MAAMC,eAAe,GAAG,CAACC,KAA4B,GAAK;QACxD,OAAOJ,iBAAiB,eAAC,KAACC,gBAAgB;YAAE,GAAGG,KAAK;UAAI,CAAC,CAAC;IAC5D,CAAC,AAAC;IAEF,4EAA4E;IAC5E,MAAMC,UAAU,GAAG,UAAY;QAC7B,MAAMC,MAAM,GAAGP,MAAM,CAACQ,SAAS,CAAC,QA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,MAAMC,QAAQ,GAAGC,IAAI,CAACC,EAAE,CAAC,CAACC,CAAC,GAAK;YAC9BL,aAAa,GAAGK,CAAC,CAACC,MAAM,CAACd,KAAK,CAAC;QACjC,CAAC,CAAC,AAAC;QACHV,eAAe,CAAC;YACdS,UAAU,EAAE,UAAU;YACtBC,KAAK,EAAE,eAAe;YACtBU,QAAQ;SACT,CAAC,CAAC;QAEH,MAAMlB,UAAU,EAAE,CAAC;QACnB,MAAMuB,SAAS,GAAG7B,MAAM,CAACQ,SAAS,CAAC,QAAQ,EAAE;YAAEW,IAAI,EAAE,eAAe;SAAE,CAAC,AAAC;QACxEpB,SAAS,CAACU,KAAK,CAACoB,SAAS,CAAC,CAAC;QAE3Bd,MAAM,CAACS,QAAQ,CAAC,CAACM,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC1Cf,MAAM,CAACO,aAAa,CAAC,CAACS,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginRegistry.test.d.ts","sourceRoot":"","sources":["../../../src/components/PluginRegistry/PluginRegistry.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import { screen } from '@testing-library/react';
|
|
16
|
-
import { useListPluginMetadata, usePlugin } from '../../runtime';
|
|
17
|
-
import { renderWithContext } from '../../test';
|
|
18
|
-
describe('PluginRegistry', ()=>{
|
|
19
|
-
const renderPluginRegistry = (children)=>{
|
|
20
|
-
renderWithContext(children);
|
|
21
|
-
};
|
|
22
|
-
it('can load a plugin that exists', async ()=>{
|
|
23
|
-
renderPluginRegistry(/*#__PURE__*/ _jsx(PluginConsumer, {
|
|
24
|
-
pluginType: "Variable",
|
|
25
|
-
kind: "ErnieVariable"
|
|
26
|
-
}));
|
|
27
|
-
const hasPlugin = await screen.findByText('Has plugin: true', undefined, {
|
|
28
|
-
timeout: 3000
|
|
29
|
-
});
|
|
30
|
-
expect(hasPlugin).toBeInTheDocument();
|
|
31
|
-
});
|
|
32
|
-
it('errors when plugin is not installed', async ()=>{
|
|
33
|
-
// This plugin is not in the test metadata at all
|
|
34
|
-
renderPluginRegistry(/*#__PURE__*/ _jsx(PluginConsumer, {
|
|
35
|
-
pluginType: "TimeSeriesQuery",
|
|
36
|
-
kind: "NotInstalled"
|
|
37
|
-
}));
|
|
38
|
-
const error = await screen.findByText(/error:/i);
|
|
39
|
-
expect(error).toBeInTheDocument();
|
|
40
|
-
expect(error).toHaveTextContent(/not installed/i);
|
|
41
|
-
});
|
|
42
|
-
it('errors when plugin is missing from the module', async ()=>{
|
|
43
|
-
// This plugin is in the test metadata, but the code is missing from the module
|
|
44
|
-
renderPluginRegistry(/*#__PURE__*/ _jsx(PluginConsumer, {
|
|
45
|
-
pluginType: "Variable",
|
|
46
|
-
kind: "MissingErnieVariable"
|
|
47
|
-
}));
|
|
48
|
-
const error = await screen.findByText(/error:/i);
|
|
49
|
-
expect(error).toBeInTheDocument();
|
|
50
|
-
expect(error).toHaveTextContent(/missing/i);
|
|
51
|
-
});
|
|
52
|
-
it('lists metadata for plugin metadata that exists', async ()=>{
|
|
53
|
-
// There should be 3 variable plugins across both test modules
|
|
54
|
-
renderPluginRegistry(/*#__PURE__*/ _jsx(MetadataConsumer, {
|
|
55
|
-
pluginType: "Variable"
|
|
56
|
-
}));
|
|
57
|
-
const table = await screen.findByRole('table');
|
|
58
|
-
expect(table).toBeInTheDocument();
|
|
59
|
-
const rows = screen.getAllByRole('row');
|
|
60
|
-
expect(rows).toHaveLength(3);
|
|
61
|
-
});
|
|
62
|
-
it('lists metadata for plugin types with no plugins available', async ()=>{
|
|
63
|
-
// There are no TimeSeriesQuery plugins in any of the test modules
|
|
64
|
-
renderPluginRegistry(/*#__PURE__*/ _jsx(MetadataConsumer, {
|
|
65
|
-
pluginType: "TimeSeriesQuery"
|
|
66
|
-
}));
|
|
67
|
-
const table = await screen.findByRole('table');
|
|
68
|
-
expect(table).toBeInTheDocument();
|
|
69
|
-
const rows = screen.queryAllByRole('row');
|
|
70
|
-
expect(rows).toHaveLength(0);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
// A helper component for testing the PluginRegistry by calling usePlugin to load a plugin
|
|
74
|
-
const PluginConsumer = (props)=>{
|
|
75
|
-
const { data: plugin , isLoading , error } = usePlugin(props.pluginType, props.kind);
|
|
76
|
-
if (error) {
|
|
77
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
78
|
-
children: [
|
|
79
|
-
"Error: ",
|
|
80
|
-
error.message
|
|
81
|
-
]
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
if (isLoading) {
|
|
85
|
-
return /*#__PURE__*/ _jsx("div", {
|
|
86
|
-
children: "Loading"
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
90
|
-
children: [
|
|
91
|
-
"Has plugin: ",
|
|
92
|
-
(plugin !== undefined).toString()
|
|
93
|
-
]
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
// A helper component for testing the PluginRegistry metadata APIs by calling useListPluginMetadata
|
|
97
|
-
const MetadataConsumer = (props)=>{
|
|
98
|
-
const { data: pluginMetadata , isLoading , error } = useListPluginMetadata(props.pluginType);
|
|
99
|
-
if (error) {
|
|
100
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
101
|
-
children: [
|
|
102
|
-
"Error: ",
|
|
103
|
-
error.message
|
|
104
|
-
]
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
if (isLoading) {
|
|
108
|
-
return /*#__PURE__*/ _jsx("div", {
|
|
109
|
-
children: "Loading"
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
if (pluginMetadata === undefined) {
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
return /*#__PURE__*/ _jsx("table", {
|
|
116
|
-
children: /*#__PURE__*/ _jsx("tbody", {
|
|
117
|
-
children: pluginMetadata.map((item)=>/*#__PURE__*/ _jsxs("tr", {
|
|
118
|
-
children: [
|
|
119
|
-
/*#__PURE__*/ _jsx("td", {
|
|
120
|
-
children: item.pluginType
|
|
121
|
-
}),
|
|
122
|
-
/*#__PURE__*/ _jsx("td", {
|
|
123
|
-
children: item.kind
|
|
124
|
-
}),
|
|
125
|
-
/*#__PURE__*/ _jsx("td", {
|
|
126
|
-
children: item.display.name
|
|
127
|
-
}),
|
|
128
|
-
/*#__PURE__*/ _jsx("td", {
|
|
129
|
-
children: item.display.description
|
|
130
|
-
})
|
|
131
|
-
]
|
|
132
|
-
}, item.kind))
|
|
133
|
-
})
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
//# sourceMappingURL=PluginRegistry.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PluginRegistry/PluginRegistry.test.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport { screen } from '@testing-library/react';\nimport { PluginType } from '../../model';\nimport { useListPluginMetadata, usePlugin } from '../../runtime';\nimport { renderWithContext } from '../../test';\n\ndescribe('PluginRegistry', () => {\n const renderPluginRegistry = (children: React.ReactNode) => {\n renderWithContext(children);\n };\n\n it('can load a plugin that exists', async () => {\n renderPluginRegistry(<PluginConsumer pluginType=\"Variable\" kind=\"ErnieVariable\" />);\n\n const hasPlugin = await screen.findByText('Has plugin: true', undefined, { timeout: 3000 });\n expect(hasPlugin).toBeInTheDocument();\n });\n\n it('errors when plugin is not installed', async () => {\n // This plugin is not in the test metadata at all\n renderPluginRegistry(<PluginConsumer pluginType=\"TimeSeriesQuery\" kind=\"NotInstalled\" />);\n\n const error = await screen.findByText(/error:/i);\n expect(error).toBeInTheDocument();\n expect(error).toHaveTextContent(/not installed/i);\n });\n\n it('errors when plugin is missing from the module', async () => {\n // This plugin is in the test metadata, but the code is missing from the module\n renderPluginRegistry(<PluginConsumer pluginType=\"Variable\" kind=\"MissingErnieVariable\" />);\n\n const error = await screen.findByText(/error:/i);\n expect(error).toBeInTheDocument();\n expect(error).toHaveTextContent(/missing/i);\n });\n\n it('lists metadata for plugin metadata that exists', async () => {\n // There should be 3 variable plugins across both test modules\n renderPluginRegistry(<MetadataConsumer pluginType=\"Variable\" />);\n\n const table = await screen.findByRole('table');\n expect(table).toBeInTheDocument();\n const rows = screen.getAllByRole('row');\n expect(rows).toHaveLength(3);\n });\n\n it('lists metadata for plugin types with no plugins available', async () => {\n // There are no TimeSeriesQuery plugins in any of the test modules\n renderPluginRegistry(<MetadataConsumer pluginType=\"TimeSeriesQuery\" />);\n\n const table = await screen.findByRole('table');\n expect(table).toBeInTheDocument();\n const rows = screen.queryAllByRole('row');\n expect(rows).toHaveLength(0);\n });\n});\n\n// A helper component for testing the PluginRegistry by calling usePlugin to load a plugin\nconst PluginConsumer = (props: { pluginType: PluginType; kind: string }) => {\n const { data: plugin, isLoading, error } = usePlugin(props.pluginType, props.kind);\n if (error) {\n return <div>Error: {(error as Error).message}</div>;\n }\n if (isLoading) {\n return <div>Loading</div>;\n }\n return <div>Has plugin: {(plugin !== undefined).toString()}</div>;\n};\n\n// A helper component for testing the PluginRegistry metadata APIs by calling useListPluginMetadata\nconst MetadataConsumer = (props: { pluginType: PluginType }) => {\n const { data: pluginMetadata, isLoading, error } = useListPluginMetadata(props.pluginType);\n if (error) {\n return <div>Error: {(error as Error).message}</div>;\n }\n if (isLoading) {\n return <div>Loading</div>;\n }\n\n if (pluginMetadata === undefined) {\n return null;\n }\n\n return (\n <table>\n <tbody>\n {pluginMetadata.map((item) => (\n <tr key={item.kind}>\n <td>{item.pluginType}</td>\n <td>{item.kind}</td>\n <td>{item.display.name}</td>\n <td>{item.display.description}</td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n"],"names":["React","screen","useListPluginMetadata","usePlugin","renderWithContext","describe","renderPluginRegistry","children","it","PluginConsumer","pluginType","kind","hasPlugin","findByText","undefined","timeout","expect","toBeInTheDocument","error","toHaveTextContent","MetadataConsumer","table","findByRole","rows","getAllByRole","toHaveLength","queryAllByRole","props","data","plugin","isLoading","div","message","toString","pluginMetadata","tbody","map","item","tr","td","display","name","description"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,OAAOA,KAAK,MAAM,OAAO,CAAC;AAC1B,SAASC,MAAM,QAAQ,wBAAwB,CAAC;AAEhD,SAASC,qBAAqB,EAAEC,SAAS,QAAQ,eAAe,CAAC;AACjE,SAASC,iBAAiB,QAAQ,YAAY,CAAC;AA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.test.d.ts","sourceRoot":"","sources":["../../src/components/PluginSpecEditor.test.tsx"],"names":[],"mappings":""}
|