Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
MonPote committed Aug 27, 2024
1 parent e91edbc commit 0289d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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, {
Expand All @@ -60,6 +62,7 @@ describe('AccountInfo', () => {
email: '[email protected]',
groups: ['StorageManager', 'user', 'PlatformAdmin'],
},
getToken: async () => fakeToken,
};
});
});
Expand Down Expand Up @@ -101,6 +104,7 @@ describe('AccountInfo', () => {
email: '[email protected]',
groups: ['user', 'PlatformAdmin'],
},
getToken: async () => fakeToken,
};
});
//S+E
Expand Down Expand Up @@ -175,15 +179,18 @@ describe('AccountInfo', () => {
renderWithRouterMatch(<AccountInfo account={account1} />, 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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -25,7 +26,7 @@ describe('PensieveAccountsAdapter - listLocations', () => {
const SUT = new PensieveAccountsLocationsAdapter(
baseUrl,
instanceId,
token,
mockGettoken,
);
server.use(
rest.get(
Expand All @@ -44,7 +45,7 @@ describe('PensieveAccountsAdapter - listLocations', () => {
const SUT = new PensieveAccountsLocationsAdapter(
baseUrl,
instanceId,
token,
mockGettoken,
);

//E
Expand Down

0 comments on commit 0289d95

Please sign in to comment.