Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho committed Jul 17, 2024
1 parent a62ea61 commit 9b63f36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 161 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -85,10 +81,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -131,10 +123,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -177,56 +165,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
},
Object {
"href": "/tenants",
"name": "Tenants",
},
Object {
"href": "/auditLogging",
"name": "Audit logs",
},
]
}
/>
</EuiPageSideBar>
</Route>
<Route
exact={true}
key="/serviceAccounts"
path="/serviceAccounts"
>
<EuiPageSideBar>
<NavPanel
items={
Array [
Object {
"href": "/getstarted",
"name": "Get Started",
},
Object {
"href": "/auth",
"name": "Authentication",
},
Object {
"href": "/roles",
"name": "Roles",
},
Object {
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -269,10 +207,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -315,10 +249,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -361,10 +291,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -407,10 +333,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -453,10 +375,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -499,10 +417,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
"href": "/users",
"name": "Internal users",
},
Object {
"href": "/serviceAccounts",
"name": "Service Accounts",
},
Object {
"href": "/permissions",
"name": "Permissions",
Expand Down Expand Up @@ -550,10 +464,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
path="/users"
render={[Function]}
/>
<Route
path="/serviceAccounts"
render={[Function]}
/>
<Route
path="/auditLogging/edit/generalSettings"
render={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,54 +42,26 @@ describe('Internal user list utils', () => {
expect(result).toEqual(expectedUserList);
});

it('getUserList calls httpGet with the correct parameters for internal users', async () => {
const httpMock = {}; // Mock HttpStart object
const userType = 'internalaccounts';

const test = await getUserList(httpMock, userType, 'test');

expect(mockedHttpGet).toHaveBeenCalledWith({
http: httpMock,
url: '/api/v1/configuration/internalaccounts',
});
expect(test).toEqual([]);
});

it('getUserList calls httpGet with the correct parameters for service accounts', async () => {
const httpMock = {};
const userType = 'serviceAccounts';

const test = await getUserList(httpMock, userType, 'test');

expect(mockedHttpGet).toHaveBeenCalledWith({
http: httpMock,
url: '/api/v1/configuration/serviceaccounts',
});
expect(test).toEqual([]);
});

it('fetchUserNameList calls httpGet with the correct parameters for service accounts', async () => {
it('getUserList calls httpGet with the correct parameters', async () => {
const httpMock = {};
const userType = 'serviceAccounts';

const test = await fetchUserNameList(httpMock, userType, '');
const test = await getUserList(httpMock, 'test');

expect(mockedHttpGet).toHaveBeenCalledWith({
http: httpMock,
url: '/api/v1/configuration/serviceaccounts',
url: '/api/v1/configuration/internalusers',
});
expect(test).toEqual([]);
});

it('fetchUserNameList calls httpGet with the correct parameters for internal users', async () => {
it('fetchUserNameList calls httpGet with the correct parameters', async () => {
const httpMock = {};
const userType = 'internalaccounts';

const test = await fetchUserNameList(httpMock, userType, '');
const test = await fetchUserNameList(httpMock, '');

expect(mockedHttpGet).toHaveBeenCalledWith({
http: httpMock,
url: '/api/v1/configuration/internalaccounts',
url: '/api/v1/configuration/internalusers',
});
expect(test).toEqual([]);
});
Expand Down

0 comments on commit 9b63f36

Please sign in to comment.