diff --git a/src/react/account/details/properties/__tests__/AccountInfo.test.tsx b/src/react/account/details/properties/__tests__/AccountInfo.test.tsx index ec2d13a7e..208b0953a 100644 --- a/src/react/account/details/properties/__tests__/AccountInfo.test.tsx +++ b/src/react/account/details/properties/__tests__/AccountInfo.test.tsx @@ -18,6 +18,7 @@ import { useAuth } from '../../../../next-architecture/ui/AuthProvider'; import userEvent from '@testing-library/user-event'; import { Route, Switch } from 'react-router-dom'; import { getConfigOverlay } from '../../../../../js/mock/managementClientMSWHandlers'; +import { debug } from 'jest-preview'; const server = setupServer( getConfigOverlay(zenkoUITestConfig.managementEndpoint, INSTANCE_ID), @@ -39,6 +40,7 @@ const account1 = { quotaMax: 1, Name: 'bart', }; +const fakeToken = 'xxx-yyy-zzz-token'; function testRow(rowWrapper, { key, value, extraCellComponent }) { testTableRow(T, rowWrapper, { @@ -60,6 +62,7 @@ describe('AccountInfo', () => { email: 'renard.admin@scality.com', groups: ['StorageManager', 'user', 'PlatformAdmin'], }, + getToken: async () => fakeToken, }; }); }); @@ -101,6 +104,7 @@ describe('AccountInfo', () => { email: 'renard.admin@scality.com', groups: ['user', 'PlatformAdmin'], }, + getToken: async () => fakeToken, }; }); //S+E @@ -175,15 +179,18 @@ describe('AccountInfo', () => { renderWithRouterMatch(, undefined, { instances: { selectedId: INSTANCE_ID }, }); + await userEvent.click( screen.getByRole('button', { name: /Delete Account/i }), ); + await userEvent.click( within(screen.getByRole('dialog', { name: /Confirmation/i })).getByRole( 'button', { name: /delete/i }, ), ); + debug(); //V await waitFor(() => { expect( diff --git a/src/react/next-architecture/adapters/accounts-locations/PensieveAccountsLocationsAdapterListLocations.test.ts b/src/react/next-architecture/adapters/accounts-locations/PensieveAccountsLocationsAdapterListLocations.test.ts index 05ac3f784..14b88e5c2 100644 --- a/src/react/next-architecture/adapters/accounts-locations/PensieveAccountsLocationsAdapterListLocations.test.ts +++ b/src/react/next-architecture/adapters/accounts-locations/PensieveAccountsLocationsAdapterListLocations.test.ts @@ -9,6 +9,7 @@ import { PensieveAccountsLocationsAdapter } from './PensieveAccountsLocationsAda const baseUrl = 'http://localhost:8080'; const instanceId = 'test-instance-id'; const server = setupServer(getConfigOverlay(baseUrl, instanceId)); +const mockGettoken = () => Promise.resolve('test-token'); describe('PensieveAccountsAdapter - listLocations', () => { beforeEach(() => { @@ -25,7 +26,7 @@ describe('PensieveAccountsAdapter - listLocations', () => { const SUT = new PensieveAccountsLocationsAdapter( baseUrl, instanceId, - token, + mockGettoken, ); server.use( rest.get( @@ -44,7 +45,7 @@ describe('PensieveAccountsAdapter - listLocations', () => { const SUT = new PensieveAccountsLocationsAdapter( baseUrl, instanceId, - token, + mockGettoken, ); //E