Skip to content

Commit

Permalink
Button.spect
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarcnicasource committed Jun 9, 2023
1 parent 262794a commit 159f306
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
22 changes: 8 additions & 14 deletions components/__test__/Button.spec.tsx
Expand Up @@ -4,26 +4,20 @@ import { Button } from '../Button'

describe('<Button />', () => {
it('should render OK with props', () => {
// const { getByText, rerender } = render(
// <Button actionText='test' canClick={true} loading={false} />,
// )
render(
const { getByText, rerender } = render(
<Button actionText='test' canClick={true} loading={false} />,
)
// // debug();
// getByText('test')
// rerender(<Button actionText={'test'} canClick={true} loading={true} />)
// // debug()
// getByText('Loading...')
// debug();
getByText('test')
rerender(<Button actionText={'test'} canClick={true} loading={true} />)
// debug()
getByText('Loading...')
})
it('should display loading', () => {
render(
const { getByText } = render(
<Button actionText={'test'} canClick={false} loading={true} />,
)
// const { getByText } = render(
// <Button actionText={'test'} canClick={false} loading={true} />,
// )
// getByText('Loading...')
getByText('Loading...')
// expect(container.firstChild).toHaveClass("pointer-events-none")
})
})
2 changes: 1 addition & 1 deletion lib/withData.tsx
Expand Up @@ -45,7 +45,7 @@ export default withApollo(({ ctx, headers, initialState }) => {
? `${process.env.NEXT_PUBLIC_DOMAIN}`
: `${process.env.NEXT_PUBLIC_DOMAIN}`,
});

const authLink = setContext((_, { headers }) => {
return {
headers: {
Expand Down

1 comment on commit 159f306

@vercel
Copy link

@vercel vercel bot commented on 159f306 Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.