Skip to content

Commit

Permalink
working Complaint Detail view
Browse files Browse the repository at this point in the history
test update, restore detail slice temporary to test something

remove detail slice

working aggregations query

standardize fetch aggs into single hook

remove aggsslice

remove queryManager middleware

cleanup, remove more stuff

working map tab

logic to disable query hook

remove message middleware

list view working

cleanup, passing query params to api so we can extract to transformResponse

Save work

save work

move color map to api

remove query manager things

missing dep

more loogic to prevent query from firing when not initialized

working pagination, moved breakpoints to API, and passing them through pagination component

remove breakpoints from querySlice

cleanup

remove persist

clean up comments and errors

complaint detail test updates

save work, clearing out URL unused clode

cleanup

querySlice tests updated

trends test fixes

tile map test

squash lines

add prettier ignore file

updating tests, refactor product

save. working tests for Company filter

refactor

update dist

fixing pill test

issue test fix

restructure files

restore

update tests

save some work

trend depth toggle unit test

squash

moved files

focus header test fixes?

save stuff

searchpanel fix

fixing pagination

unit tests

fixing app.spec test

unit test actionbar
  • Loading branch information
flacoman91 committed Nov 8, 2024
1 parent 83287dc commit 8e06b0f
Show file tree
Hide file tree
Showing 146 changed files with 1,944 additions and 4,755 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/__fixtures__/**
**/fixture.js
2 changes: 1 addition & 1 deletion dist/ccdb5.css.map

Large diffs are not rendered by default.

118 changes: 98 additions & 20 deletions dist/ccdb5.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dist/ccdb5.js.map

Large diffs are not rendered by default.

28 changes: 26 additions & 2 deletions src/App.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,37 @@ import 'regenerator-runtime/runtime';
import { MemoryRouter, Route, Routes } from 'react-router-dom';
import { render, screen } from '@testing-library/react';
import * as useUpdateLocationHook from './hooks/useUpdateLocation';
import store from './app/store';
import { ComplaintDetail } from './components/ComplaintDetail/ComplaintDetail';
import { waitFor } from './testUtils/test-utils';
import { configureStoreUtil, waitFor } from './testUtils/test-utils';
import fetchMock from 'jest-fetch-mock';
import { aggResponse } from './components/List/ListPanel/fixture';
import { trendsResponse } from './components/Trends/fixture';
jest.mock('highcharts/modules/accessibility');
jest.mock('highcharts/highmaps');

describe('initial state', () => {
let store;
beforeEach(() => {
fetchMock.resetMocks();
store = configureStoreUtil({ routes: { queryString: '??Fdsfdssdf' } });
});

it('renders search page', async () => {
fetchMock.mockResponse((req) => {
const url = new URL(req.url);
const params = url.searchParams;

if (params.get('size') === '0') {
// this is the list
return Promise.resolve({
body: JSON.stringify(aggResponse),
});
} else if (params.get('no_aggs')) {
return Promise.resolve({
body: JSON.stringify(trendsResponse),
});
}
});
const updateLocationHookSpy = jest.spyOn(
useUpdateLocationHook,
'useUpdateLocation',
Expand All @@ -22,6 +45,7 @@ describe('initial state', () => {
</Provider>,
);

await screen.findByText(/Search within/);
expect(updateLocationHookSpy).toBeCalledTimes(1);
expect(screen.getByText(/Consumer Complaint Database/)).toBeInTheDocument();
expect(screen.getByText(/Search within/)).toBeInTheDocument();
Expand Down
8 changes: 0 additions & 8 deletions src/actions/__fixtures__/emptyStore.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import { aggsState as aggs } from '../../reducers/aggs/aggsSlice';
import { detailState as detail } from '../../reducers/detail/detailSlice';
import { filtersState as filters } from '../../reducers/filters/filtersSlice';
import { mapState as map } from '../../reducers/map/mapSlice';
import { queryState as query } from '../../reducers/query/querySlice';
import { resultsState as results } from '../../reducers/results/resultsSlice';
import { routesState as routes } from '../../reducers/routes/routesSlice';
import { trendsState as trends } from '../../reducers/trends/trendsSlice';
import { viewState as view } from '../../reducers/view/viewSlice';

export default Object.freeze({
aggs,
detail,
filters,
map,
query,
results,
routes,
trends,
view,
Expand Down
179 changes: 0 additions & 179 deletions src/actions/__tests__/complaints.spec.js

This file was deleted.

143 changes: 0 additions & 143 deletions src/actions/complaints.js

This file was deleted.

Loading

0 comments on commit 8e06b0f

Please sign in to comment.