Skip to content

Commit

Permalink
Merge pull request #160 from brunomous/feature/move-storage-settings-…
Browse files Browse the repository at this point in the history
…model

Move Filter and Table cache logic and remove ComposedTable component
  • Loading branch information
andreneto97 authored Aug 5, 2024
2 parents bb3591f + d41d42d commit 3e25196
Show file tree
Hide file tree
Showing 15 changed files with 286 additions and 648 deletions.
151 changes: 0 additions & 151 deletions packages/react-material-ui/__tests__/ComposedTable.spec.tsx

This file was deleted.

18 changes: 10 additions & 8 deletions packages/react-material-ui/__tests__/Filter.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React from 'react';
import { fireEvent, render, waitFor } from '@testing-library/react';
import { Filter, FilterType } from '../src/components/Filter/Filter';

const SETTINGS_ID = 'testing';
const SETTINGS_KEY = 'testing';

describe('Filter Component', () => {
const allFilters: FilterType[] = [
Expand Down Expand Up @@ -52,7 +52,7 @@ describe('Filter Component', () => {

it('renders textfield component if type is "Text"', () => {
const { getByPlaceholderText } = render(
<Filter filters={[allFilters[0]]} settingsId={SETTINGS_ID} />,
<Filter filters={[allFilters[0]]} orderableListCacheKey={SETTINGS_KEY} />,
);

const input = getByPlaceholderText('Text Test Placeholder');
Expand All @@ -61,7 +61,7 @@ describe('Filter Component', () => {

it('renders autocomplete component if type is "Autocomplete"', () => {
const { getByRole } = render(
<Filter filters={[allFilters[1]]} settingsId={SETTINGS_ID} />,
<Filter filters={[allFilters[1]]} orderableListCacheKey={SETTINGS_KEY} />,
);

const input = getByRole('combobox');
Expand All @@ -70,7 +70,7 @@ describe('Filter Component', () => {

it('renders select component if type is "Select"', () => {
const { getByLabelText } = render(
<Filter filters={[allFilters[2]]} settingsId={SETTINGS_ID} />,
<Filter filters={[allFilters[2]]} orderableListCacheKey={SETTINGS_KEY} />,
);

const input = getByLabelText('Select Test Label');
Expand All @@ -79,7 +79,7 @@ describe('Filter Component', () => {

it('renders array of filters correctly', () => {
const { container } = render(
<Filter filters={allFilters} settingsId={SETTINGS_ID} />,
<Filter filters={allFilters} orderableListCacheKey={SETTINGS_KEY} />,
);

const inputs = container.querySelectorAll('input');
Expand All @@ -99,7 +99,7 @@ describe('Filter Component', () => {

it('renders dropdown button', () => {
const { queryByTestId } = render(
<Filter filters={allFilters} settingsId={SETTINGS_ID} />,
<Filter filters={allFilters} orderableListCacheKey={SETTINGS_KEY} />,
);

const dropdownButton = queryByTestId('FilterAltIcon');
Expand All @@ -108,7 +108,7 @@ describe('Filter Component', () => {

it('opens dropdown button on click', () => {
const { queryByTestId, queryAllByTestId } = render(
<Filter filters={allFilters} settingsId={SETTINGS_ID} />,
<Filter filters={allFilters} orderableListCacheKey={SETTINGS_KEY} />,
);

const dropdownButton = queryByTestId('FilterAltIcon');
Expand All @@ -128,7 +128,9 @@ describe('Filter Component', () => {
getByPlaceholderText,
getByRole,
queryByPlaceholderText,
} = render(<Filter filters={[allFilters[0]]} settingsId={SETTINGS_ID} />);
} = render(
<Filter filters={[allFilters[0]]} orderableListCacheKey={SETTINGS_KEY} />,
);

const textInput = getByPlaceholderText('Text Test Placeholder');
expect(textInput).toBeInTheDocument();
Expand Down
94 changes: 0 additions & 94 deletions packages/react-material-ui/src/components/ComposedTable/README.md

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3e25196

Please sign in to comment.