Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linter fixes
Browse files Browse the repository at this point in the history
brendan-defi committed Dec 13, 2024
1 parent 4e7376e commit b24c438
Showing 5 changed files with 21 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"tabWidth": 2,
"singleQuote": true
"singleQuote": true,
"trailingComma": "all"
}
30 changes: 15 additions & 15 deletions src/wallet/components/ConnectWallet.test.tsx
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ describe('ConnectWallet', () => {
render(
<ConnectWallet text="Connect Wallet">
<div>Wallet Connected</div>
</ConnectWallet>
</ConnectWallet>,
);
const connectedText = screen.getByText('Wallet Connected');
expect(connectedText).toBeInTheDocument();
@@ -115,7 +115,7 @@ describe('ConnectWallet', () => {
},
{
onSuccess: expect.any(Function),
}
},
);
});

@@ -135,7 +135,7 @@ describe('ConnectWallet', () => {
const { rerender } = render(
<ConnectWallet text="Connect Wallet">
<div>Wallet Connected</div>
</ConnectWallet>
</ConnectWallet>,
);
const button = screen.getByText('Wallet Connected');
fireEvent.click(button);
@@ -150,7 +150,7 @@ describe('ConnectWallet', () => {
rerender(
<ConnectWallet text="Connect Wallet">
<div>Wallet Connected</div>
</ConnectWallet>
</ConnectWallet>,
);

fireEvent.click(button);
@@ -174,7 +174,7 @@ describe('ConnectWallet', () => {
render(
<ConnectWallet>
<span>Test Children</span>
</ConnectWallet>
</ConnectWallet>,
);
const button = screen.getByTestId('ockConnectWallet_Connected');
expect(button).toHaveClass('ock-bg-secondary-active');
@@ -189,7 +189,7 @@ describe('ConnectWallet', () => {
<ConnectWallet>
<ConnectWalletText>Not Render</ConnectWalletText>
<div>Wallet Ciao</div>
</ConnectWallet>
</ConnectWallet>,
);
const connectedText = screen.getByText('Wallet Ciao');
expect(connectedText).toBeInTheDocument();
@@ -280,7 +280,7 @@ describe('ConnectWallet', () => {

expect(connectMock).toHaveBeenCalledWith(
{ connector: { id: 'mockConnector' } },
{ onSuccess: expect.any(Function) }
{ onSuccess: expect.any(Function) },
);
});
});
@@ -295,7 +295,7 @@ describe('ConnectWallet', () => {
render(
<ConnectWallet>
<ConnectWalletText>Custom Connect Text</ConnectWalletText>
</ConnectWallet>
</ConnectWallet>,
);

const button = screen.getByTestId('ockConnectButton');
@@ -324,7 +324,7 @@ describe('ConnectWallet', () => {

expect(connectMock).toHaveBeenCalledWith(
{ connector: { id: 'mockConnector' } },
{ onSuccess: expect.any(Function) }
{ onSuccess: expect.any(Function) },
);

connectMock.mock.calls[0][1].onSuccess();
@@ -393,7 +393,7 @@ describe('ConnectWallet', () => {
});

const { rerender } = render(
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />,
);

const button = screen.getByTestId('ockConnectButton');
@@ -408,13 +408,13 @@ describe('ConnectWallet', () => {
});

rerender(
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />,
);

expect(onConnectMock).toHaveBeenCalledTimes(1);

rerender(
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />,
);
expect(onConnectMock).toHaveBeenCalledTimes(1);
});
@@ -493,7 +493,7 @@ describe('ConnectWallet', () => {
});

const { rerender } = render(
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />,
);

const button = screen.getByTestId('ockConnectButton');
@@ -505,13 +505,13 @@ describe('ConnectWallet', () => {
});

rerender(
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />,
);

expect(onConnectMock).toHaveBeenCalledTimes(1);

rerender(
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />
<ConnectWallet text="Connect Wallet" onConnect={onConnectMock} />,
);
expect(onConnectMock).toHaveBeenCalledTimes(1);
});
4 changes: 2 additions & 2 deletions src/wallet/components/WalletDropdown.test.tsx
Original file line number Diff line number Diff line change
@@ -102,10 +102,10 @@ describe('WalletDropdown', () => {
useWalletContextMock.mockReturnValue({ isOpen: true, isClosing: false });
const { rerender } = render(<WalletDropdown>Content</WalletDropdown>);
const dropdown = screen.getByTestId('ockWalletDropdown');
expect(dropdown).toHaveClass('animate-walletIslandContainerIn');
expect(dropdown).toHaveClass('animate-walletContainerIn');

useWalletContextMock.mockReturnValue({ isOpen: true, isClosing: true });
rerender(<WalletDropdown>Content</WalletDropdown>);
expect(dropdown).toHaveClass('animate-walletIslandContainerOut');
expect(dropdown).toHaveClass('animate-walletContainerOut');
});
});
2 changes: 1 addition & 1 deletion src/wallet/components/WalletDropdown.tsx
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ export function WalletDropdown({ children, className }: WalletDropdownReact) {
pressable.default,
color.foreground,
'absolute right-0 z-10 mt-1 flex w-max min-w-[300px] cursor-default flex-col overflow-hidden rounded-xl',
(isClosing || !isOpen)
isClosing || !isOpen
? 'animate-walletContainerOut'
: 'animate-walletContainerIn',
className,
2 changes: 1 addition & 1 deletion src/wallet/components/WalletProvider.test.tsx
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ describe('useWalletContext', () => {
<WalletProvider>
<div />
</WalletProvider>
</WagmiProvider>
</WagmiProvider>,
);

const { result } = renderHook(() => useWalletContext(), {

0 comments on commit b24c438

Please sign in to comment.