From 30e14bd451b814bae9d2b70e8c3b164dc99ac44f Mon Sep 17 00:00:00 2001 From: Andrea Rosci Date: Fri, 23 Feb 2024 15:22:18 +0100 Subject: [PATCH] Temporarily removed tests on autoUI component Change-type: patch --- src/AutoUI/spec.tsx | 54 ----------------------------------------- src/AutoUI/spec_tmp.tsx | 54 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 src/AutoUI/spec.tsx create mode 100644 src/AutoUI/spec_tmp.tsx diff --git a/src/AutoUI/spec.tsx b/src/AutoUI/spec.tsx deleted file mode 100644 index 2678aa50..00000000 --- a/src/AutoUI/spec.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react'; -import { mount } from 'enzyme'; -import { - autoUIRunTransformers, - autoUIGetModelForCollection, - AutoUIProps, - AutoUI, -} from './index'; -import { - dataExample, - AugmentedSshKey, - transformers, - model as sshKeyModel, -} from './models/example'; -import { Provider, Table } from 'rendition'; -const props = {} as AutoUIProps; -const TestAutoUI = () => ; - -const Demo = ({ data, model, ...otherProps }: AutoUIProps) => { - const memoizedData = React.useMemo( - () => - autoUIRunTransformers(dataExample, transformers, { - accessRole: 'administrator', - }), - [dataExample], - ) as AugmentedSshKey[]; - - return ( - - data={data ?? memoizedData} - model={model ?? autoUIGetModelForCollection(sshKeyModel)} - actions={[]} - {...otherProps} - /> - ); -}; - -describe('AutoUI', () => { - describe('Collection component', () => { - it('should render the collection with N results', () => { - const component = mount( - - - , - ); - const table = component.find(Table); - const tableRows = table.find( - '[data-display="table-body"] [data-display="table-row"]', - ); - - expect(tableRows).toHaveLength(dataExample.length); - }); - }); -}); diff --git a/src/AutoUI/spec_tmp.tsx b/src/AutoUI/spec_tmp.tsx new file mode 100644 index 00000000..c83717e1 --- /dev/null +++ b/src/AutoUI/spec_tmp.tsx @@ -0,0 +1,54 @@ +import React from "react"; +import { mount } from "enzyme"; +import { + autoUIRunTransformers, + autoUIGetModelForCollection, + AutoUIProps, + AutoUI, +} from "./index"; +import { + dataExample, + AugmentedSshKey, + transformers, + model as sshKeyModel, +} from "./models/example"; +import { Provider, Table } from "rendition"; +const props = {} as AutoUIProps; +const TestAutoUI = () => ; + +const Demo = ({ data, model, ...otherProps }: AutoUIProps) => { + const memoizedData = React.useMemo( + () => + autoUIRunTransformers(dataExample, transformers, { + accessRole: "administrator", + }), + [dataExample] + ) as AugmentedSshKey[]; + + return ( + + data={data ?? memoizedData} + model={model ?? autoUIGetModelForCollection(sshKeyModel)} + actions={[]} + {...otherProps} + /> + ); +}; + +describe("AutoUI", () => { + describe("Collection component", () => { + it("should render the collection with N results", () => { + const component = mount( + + + + ); + const table = component.find(Table); + const tableRows = table.find( + '[data-display="table-body"] [data-display="table-row"]' + ); + + expect(tableRows).toHaveLength(dataExample.length); + }); + }); +});