diff --git a/.gitignore b/.gitignore index 14eed736..a091d178 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ nodemon.json /myscripts .DS_Store /server_build -google_vision_api_key.json \ No newline at end of file +google_vision_api_key.json +/client/dist \ No newline at end of file diff --git a/client/.gitignore b/client/.gitignore deleted file mode 100644 index a547bf36..00000000 --- a/client/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -node_modules -dist -dist-ssr -*.local - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea -.DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? diff --git a/client/src/components/modal/Front/SwipableImage.tsx b/client/src/components/modal/Front/SwipableImage.tsx index 4688edbc..c2a32125 100644 --- a/client/src/components/modal/Front/SwipableImage.tsx +++ b/client/src/components/modal/Front/SwipableImage.tsx @@ -76,7 +76,6 @@ function SwipableImage({ zoomInfo, onSlidePin, onSetImageMetaData }: SwipableIma marginLeft: 'auto', marginRight: 'auto', objectFit: 'contain', - borderColor: 'black', border: parentDivStyle.border, }} onLoad={onPinLoad} diff --git a/client/src/components/signin/logout.tsx b/client/src/components/signin/logout.tsx index 2557f15a..59608192 100644 --- a/client/src/components/signin/logout.tsx +++ b/client/src/components/signin/logout.tsx @@ -1,18 +1,7 @@ import { useEffect } from 'react'; -import { useHistory } from 'react-router-dom'; -import { useDispatch } from 'react-redux'; -import { getUser } from '../../actions/authentication'; -import RESTcall from '../../crud'; function LogOut() { - const history = useHistory(); - const dispatch = useDispatch(); - const logout = async () => { - // TODO: vite erroring out on axios rest call to auth/logout - // await RESTcall({ address: '/auth/logout' }); - // dispatch(getUser('/auth/profile')); - // history.replace('/logout'); window.location.assign('/auth/logout'); }; diff --git a/tests/client/src/components/modal/Front/__snapshots__/SwipableImage.test.tsx.snap b/tests/client/src/components/modal/Front/__snapshots__/SwipableImage.test.tsx.snap index a98bb536..e6cb446e 100644 --- a/tests/client/src/components/modal/Front/__snapshots__/SwipableImage.test.tsx.snap +++ b/tests/client/src/components/modal/Front/__snapshots__/SwipableImage.test.tsx.snap @@ -15,7 +15,6 @@ exports[`will render with the list item bar 1`] = ` sx={ { "border": 0, - "borderColor": "black", "height": 500, "marginLeft": "auto", "marginRight": "auto", @@ -98,7 +97,6 @@ exports[`will render without the list item bar 1`] = ` sx={ { "border": 0, - "borderColor": "black", "height": 500, "marginLeft": "auto", "marginRight": "auto", diff --git a/tests/client/src/components/signin/logout.test.tsx b/tests/client/src/components/signin/logout.test.tsx index ac359fc8..2277c52c 100644 --- a/tests/client/src/components/signin/logout.test.tsx +++ b/tests/client/src/components/signin/logout.test.tsx @@ -1,33 +1,18 @@ +/** + * @jest-environment jsdom + */ import React from 'react'; import { shallow } from 'enzyme'; -import * as router from 'react-router-dom'; import LogOut from '../../../../../client/src/components/signin/logout'; -import RESTcall from '../../../../../client/src/crud'; -const mockdispatch = jest.fn(); -// Mock RESTcall -jest.mock('../../../../../client/src/crud'); -// Mock redux hooks -jest.mock('react-redux', () => ({ - ...jest.requireActual('react-redux'), // use actual for all non-hook parts - useDispatch: jest.fn(() => mockdispatch), -})); - -// Mock router hooks -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), // use actual for all non-hook parts - useHistory: jest.fn(), -})); +const windowSpy = jest.spyOn(window, 'location', 'get'); +const mockedAssign: jest.Mock = jest.fn(); +windowSpy.mockReturnValue({ + ...window.location, + assign: mockedAssign, +}); -xtest('will logout a user', async () => { - const replace = jest.fn(); - const hist = router.useHistory(); - jest - .spyOn(router, 'useHistory') - .mockImplementation(() => ({ ...hist, replace })); +test('will logout a user', () => { shallow(); - await Promise.resolve(); - expect(RESTcall).toHaveBeenCalledWith({ address: '/auth/logout' }); - expect(mockdispatch).toHaveBeenCalled(); - expect(replace).toHaveBeenCalledWith('/'); + expect(mockedAssign).toHaveBeenCalledWith('/auth/logout'); });