Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/chromatic #3

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3cbfd61
Squashed commit of the following:
tchalvak Dec 24, 2023
0ca038b
Add back in errorboundary component.
tchalvak Dec 24, 2023
692f25c
Add Feedbackify comp.
tchalvak Dec 24, 2023
4ccd73c
Add News comp and react-hooks-form.
tchalvak Dec 24, 2023
78438f1
Add AccountSummary comp.
tchalvak Dec 24, 2023
3313016
Add yarn browse:repo cmd.
tchalvak Dec 24, 2023
15c591d
Add all jest and husky.
tchalvak Dec 24, 2023
e336385
Add workspace and various next config file.
tchalvak Dec 24, 2023
6b9c1b7
Reconfigure tsconfig.
tchalvak Dec 25, 2023
3053017
Switch to using swc for tsc speed.
tchalvak Dec 25, 2023
eb1cee6
Remove trailing slash in eslintrc.
tchalvak Dec 25, 2023
81c9375
Add yarn compiled files as if they were binaries.
tchalvak Dec 25, 2023
ff517ce
Lint fixes of default unnamed objects.
tchalvak Dec 25, 2023
e5c03e6
Continued cleanup.
tchalvak Dec 25, 2023
45f0fa0
add chromatic, esbuild, and @/
tchalvak Dec 25, 2023
fc4f75d
Additional chromatic additions.
tchalvak Dec 25, 2023
2c1147d
Update readme.
tchalvak Dec 25, 2023
1fcbb72
Test lint fixes.
tchalvak Dec 25, 2023
662d2e0
Continued cleanup, and move to nextjs app struct.
tchalvak Dec 25, 2023
f634ff5
Work on tests.
tchalvak Dec 25, 2023
bb06cc6
Add mocking of auth and datastore, fix up Profile test,
tchalvak Dec 25, 2023
b189932
Got tailwind back working.
tchalvak Dec 25, 2023
ef5c612
Homepage completely revised.
tchalvak Dec 25, 2023
644dcdd
Updates to the schema approach.
tchalvak Dec 25, 2023
2bcdf6c
Test improvments, feedbackify.
tchalvak Dec 25, 2023
327f88e
fix up the AccountSummary tests.
tchalvak Dec 25, 2023
12b6c99
More file fixes.
tchalvak Dec 25, 2023
8118497
some more test fixes.
tchalvak Dec 25, 2023
8d75e78
Another test fix.
tchalvak Dec 25, 2023
0d017ca
Tests and work on the store.
tchalvak Dec 25, 2023
1727bf1
Make files typescript in schema space.
tchalvak Dec 25, 2023
3b4c83c
Modifications to schema initialization.
tchalvak Dec 25, 2023
373721b
Test fixes continued.
tchalvak Dec 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test fixes continued.
tchalvak committed Dec 25, 2023
commit 373721bf03f26b8ebc88cfa1c078eaa8812af6e3
7 changes: 4 additions & 3 deletions components/Chat/ChatMessage.test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import ReactDOM from 'react-dom'
import { createRoot } from 'react-dom/client'
import { default as ChatMessage } from './ChatMessage'

describe('<ChatMessage />', () => {
it('renders a single chat message with by and datetime', () => {
const div = document.createElement('div')
const root = ReactDOM.createRoot(div).render(<ChatMessage by={'James'} datetime={new Date()}>
const root = createRoot(div)
root.render(<ChatMessage by={'James'} datetime={new Date()}>
This would contain an actual message
</ChatMessage>)
root.unmount(div)
root.unmount()
})
})
2 changes: 1 addition & 1 deletion components/Logo/Logo.test.tsx
Original file line number Diff line number Diff line change
@@ -6,6 +6,6 @@ describe('<Logo />', () => {
const div = document.createElement('div')
const root = createRoot(div)
root.render(<Logo />)
root.unmount(div)
root.unmount()
})
})
2 changes: 1 addition & 1 deletion components/Profile/Profile.test.tsx
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ const BasicStory = composeStory(Basic, Meta)
describe('<Profile />', () => {
it('renders the basic profile story', () => {
render(<ThemeProvider theme={theme}><BasicStory /></ThemeProvider>)
expect(screen.getByText(mockPerson.charName)).toBeInTheDocument()
expect(screen.getByText(mockPerson.charName ?? 'should not match')).toBeInTheDocument()

})

5 changes: 2 additions & 3 deletions src/context/AuthContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { PropsWithChildren } from "react";
import { Auth } from '@/auth'
import { User } from '@/components/models/User'
import { useEffect, useState, useMemo } from 'react'
@@ -39,7 +38,7 @@ interface AuthProviderProps extends Record<string, string | number | boolean | R
* @param param0
* @returns
*/
const AuthProvider = ({ mockAuth = false, ...rest }: PropsWithChildren<AuthProviderProps>) => {
const AuthProvider = ({ mockAuth = false, ...rest }: AuthProviderProps) => {
const [loading, setLoading] = useState<boolean>(true)
const [session, setSession] = useState<AuthDataInfo['session']>(undefined)

@@ -82,7 +81,7 @@ const AuthProvider = ({ mockAuth = false, ...rest }: PropsWithChildren<AuthProvi
}
}, [])
useEffect(() => {
if (!mockAuth) {
if (mockAuth !== true) {
obtainAuth()
}
return () => { }
3 changes: 1 addition & 2 deletions src/context/UserContext.test.tsx
Original file line number Diff line number Diff line change
@@ -22,8 +22,7 @@ describe('<UserContext />', () => {
>
<UserRenderer />
</UserProvider>
</>,
div
</>
)
root.unmount();
})