Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aidynoJ committed Oct 9, 2024
1 parent 79f0cdb commit 8501e7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ export default class StripesCore extends Component {
const parsedTenant = storedTenant ? JSON.parse(storedTenant) : undefined;

const okapi = (typeof okapiConfig === 'object' && Object.keys(okapiConfig).length > 0)
? {
...okapiConfig,
tenant: parsedTenant?.tenantName || okapiConfig.tenant,
clientId: parsedTenant?.clientId || okapiConfig.clientId
} : { withoutOkapi: true };
? { ...okapiConfig, tenant: parsedTenant?.tenantName || okapiConfig.tenant, clientId: parsedTenant?.clientId || okapiConfig.clientId } : { withoutOkapi: true };

const initialState = merge({}, { okapi }, props.initialState);

Expand Down
5 changes: 0 additions & 5 deletions src/RootWithIntl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ const store = {
};

describe('RootWithIntl', () => {
beforeAll(() => {
const eventsPortal = document.createElement('div');
eventsPortal.id = 'events-portal';
document.body.appendChild(eventsPortal);
});
it('renders login without one of (isAuthenticated, token, disableAuth)', async () => {
const stripes = new Stripes({ epics: {}, logger: {}, bindings: {}, config: {}, store, discovery: { isFinished: false } });
await render(<Harness><RootWithIntl stripes={stripes} history={defaultHistory} isAuthenticated={false} /></Harness>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { RTR_TIMEOUT_EVENT } from '../Root/constants';

import { toggleRtrModal } from '../../okapiActions';
import { eventsPortal } from '../../constants';

jest.mock('./KeepWorkingModal', () => (() => <div>KeepWorkingModal</div>));
jest.mock('../../loginServices');
Expand All @@ -37,6 +38,11 @@ const stripes = {
};

describe('SessionEventContainer', () => {
beforeAll(() => {
const eventsPortalElement = document.createElement('div');
eventsPortalElement.id = eventsPortal;
document.body.appendChild(eventsPortalElement);
});
it('Renders nothing if useSecureTokens is false', async () => {
const insecureStripes = {
config: {
Expand Down

0 comments on commit 8501e7e

Please sign in to comment.