chore: fix mocks and hydration error (#1520)
* chore: fix DealTicket mock * chore: fix React Hydration Error * test: change tag Co-authored-by: Rado <szpiechrados@gmail.com>
This commit is contained in:
parent
8bffc05be2
commit
8dd63d7cac
@ -27,7 +27,7 @@ const mockTx = {
|
||||
},
|
||||
};
|
||||
|
||||
describe('deal ticket orders', { tags: '@regression' }, () => {
|
||||
describe('deal ticket orders', { tags: '@smoke' }, () => {
|
||||
before(() => {
|
||||
cy.mockGQL((req) => {
|
||||
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
||||
@ -158,7 +158,7 @@ describe('deal ticket orders', { tags: '@regression' }, () => {
|
||||
it.skip('unsuccessful order due to no collateral');
|
||||
});
|
||||
|
||||
describe('deal ticket validation', { tags: '@regression' }, () => {
|
||||
describe('deal ticket validation', { tags: '@smoke' }, () => {
|
||||
before(() => {
|
||||
cy.mockGQL((req) => {
|
||||
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
||||
|
@ -43,11 +43,7 @@ export const mockTradingPage = (
|
||||
aliasQuery(req, 'Orders', generateOrders());
|
||||
aliasQuery(req, 'Accounts', generateAccounts());
|
||||
aliasQuery(req, 'Positions', generatePositions());
|
||||
aliasQuery(
|
||||
req,
|
||||
'DealTicketQuery',
|
||||
generateDealTicketQuery({ market: { state } })
|
||||
);
|
||||
aliasQuery(req, 'DealTicket', generateDealTicketQuery({ market: { state } }));
|
||||
aliasQuery(
|
||||
req,
|
||||
'MarketInfoQuery',
|
||||
|
@ -29,7 +29,8 @@ const toggleTheme = () => {
|
||||
};
|
||||
|
||||
export function useThemeSwitcher(): [themeVariant, () => void] {
|
||||
const [theme, setTheme] = useState<themeVariant>(getCurrentTheme());
|
||||
const [theme, setTheme] = useState<themeVariant>(lightTheme);
|
||||
useEffect(() => setTheme(getCurrentTheme()), []);
|
||||
useEffect(() => {
|
||||
if (theme === darkTheme) {
|
||||
document.documentElement.classList.add(darkThemeCssClass);
|
||||
|
Loading…
Reference in New Issue
Block a user