fix: tests and only show error data if present
This commit is contained in:
@@ -69,7 +69,8 @@ export const ConnectionOptions = ({
|
||||
className="text-danger text-sm first-letter:uppercase"
|
||||
data-testid="connection-error"
|
||||
>
|
||||
{error.message}: {error.data}
|
||||
{error.message}
|
||||
{error.data ? `: ${error.data}` : ''}
|
||||
</p>
|
||||
)}
|
||||
<a
|
||||
|
||||
@@ -93,7 +93,6 @@ describe('disconnect', () => {
|
||||
expect(result).toEqual({ status: 'disconnected' });
|
||||
expect(config.store.getState()).toMatchObject({
|
||||
status: 'disconnected',
|
||||
error: noConnectorError(),
|
||||
current: undefined,
|
||||
keys: [],
|
||||
pubKey: undefined,
|
||||
@@ -130,7 +129,7 @@ describe('refresh keys', () => {
|
||||
it('handles invalid connector', async () => {
|
||||
await config.refreshKeys();
|
||||
expect(config.store.getState()).toMatchObject({
|
||||
error: noConnectorError(),
|
||||
error: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ export function createConfig(cfg: Config): Wallet {
|
||||
|
||||
// Only refresh keys if connnected. If you aren't connect when you connect
|
||||
// you will get the latest keys
|
||||
if (state.status === 'connected') {
|
||||
if (state.status !== 'connected') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user