-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v4.0.0
- Loading branch information
Showing
174 changed files
with
8,351 additions
and
6,886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { render, waitFor } from '@testing-library/react'; | ||
|
||
import mockConnector from 'testing/unit/__mocks__/mockConnector'; | ||
import MockProviders from 'testing/unit/__mocks__/MockProviders'; | ||
import { mockGrapqhlRequest, mockReactQuery } from 'testing/unit/__mocks__/mockQueries'; | ||
import { TEST_ADDR } from 'testing/unit/constants'; | ||
|
||
import Market from '../../pages/market'; | ||
|
||
describe('Futures market page - cross margin', () => { | ||
beforeAll(() => { | ||
// TODO: remove this when we return to writing tests | ||
jest.spyOn(console, 'error').mockImplementation(() => {}); | ||
mockReactQuery(); | ||
}); | ||
test('Displays cross margin not available when unsupported network', async () => { | ||
mockGrapqhlRequest({ crossMarginAccounts: [] }); | ||
mockConnector({ network: { id: 1, name: 'ethereum' } }); | ||
|
||
const { findAllByTestId } = render( | ||
<MockProviders> | ||
<Market /> | ||
</MockProviders> | ||
); | ||
|
||
const components = await findAllByTestId('cross-margin-unsupported-network'); | ||
// Mobile and Desktop both get rendered | ||
expect(components.length).toEqual(2); | ||
}); | ||
test('Displays cross margin onboard prompt when no cross margin account', async () => { | ||
mockGrapqhlRequest({ crossMarginAccounts: [] }); | ||
mockConnector(); | ||
|
||
const { findAllByTestId } = render( | ||
<MockProviders> | ||
<Market /> | ||
</MockProviders> | ||
); | ||
|
||
const components = await findAllByTestId('cross-margin-create-account'); | ||
// Mobile and Desktop both get rendered | ||
expect(components.length).toEqual(2); | ||
}); | ||
test('Trade panel input is disabled when wallet not connected', async () => { | ||
mockGrapqhlRequest({ crossMarginAccounts: [{ id: TEST_ADDR }] }); | ||
mockConnector(); | ||
|
||
const { findByTestId } = render( | ||
<MockProviders> | ||
<Market /> | ||
</MockProviders> | ||
); | ||
|
||
await waitFor(async () => { | ||
const component = await findByTestId('set-order-size-amount-susd-desktop'); | ||
expect(component.hasAttribute('disabled')); | ||
}); | ||
}); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
b9ccfd2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
kwenta – ./
kwenta-kwenta.vercel.app
kwenta-git-main-kwenta.vercel.app
kwenta.io