Skip to content
Snippets Groups Projects

Resolve "cookie banner for matomo"

Merged Piotr Gawron requested to merge 301-cookie-banner-for-matomo into development
23 files
+ 303
93
Compare changes
  • Side-by-side
  • Inline
Files
23
import React from 'react';
import { render, screen } from '@testing-library/react';
import { ToolkitStoreWithSingleSlice } from '@/utils/createStoreInstanceUsingSliceReducer';
import { CookieBannerState } from '@/redux/cookieBanner/cookieBanner.types';
import { getReduxWrapperUsingSliceReducer } from '@/utils/testing/getReduxWrapperUsingSliceReducer';
import cookieBannerReducer from '@/redux/cookieBanner/cookieBanner.slice';
import { act } from 'react-dom/test-utils';
import { CookieBanner } from './CookieBanner.component';
import { getReduxWrapperWithStore } from '@/utils/testing/getReduxWrapperWithStore';
import { INITIAL_STORE_STATE_MOCK } from '@/redux/root/root.fixtures';
import { StoreType } from '@/redux/store';
import { CONFIGURATION_INITIAL_STORE_MOCKS } from '@/redux/configuration/configuration.mock';
import {
USER_ACCEPTED_COOKIES_COOKIE_NAME,
USER_ACCEPTED_COOKIES_COOKIE_VALUE,
} from './CookieBanner.constants';
import { CookieBanner } from './CookieBanner.component';
const renderComponent = (): { store: ToolkitStoreWithSingleSlice<CookieBannerState> } => {
const { Wrapper, store } = getReduxWrapperUsingSliceReducer('cookieBanner', cookieBannerReducer);
const renderComponent = (): { store: StoreType } => {
// const { Wrapper, store } = getReduxWrapperUsingSliceReducer('cookieBanner', cookieBannerReducer);
//
const { Wrapper, store } = getReduxWrapperWithStore({
...INITIAL_STORE_STATE_MOCK,
configuration: CONFIGURATION_INITIAL_STORE_MOCKS,
});
return (
render(
Loading