|
|
|
@ -62,7 +62,7 @@ describe('enrichConfigItems', () => { |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
contextSrv.user.isSignedIn = false; |
|
|
|
contextSrv.user.isSignedIn = false; |
|
|
|
setContextSrv(contextSrv); |
|
|
|
setContextSrv(contextSrv); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation, jest.fn()); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation); |
|
|
|
const signInNode = enrichedConfigItems.find((item) => item.id === 'signin'); |
|
|
|
const signInNode = enrichedConfigItems.find((item) => item.id === 'signin'); |
|
|
|
expect(signInNode).toBeDefined(); |
|
|
|
expect(signInNode).toBeDefined(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -71,7 +71,7 @@ describe('enrichConfigItems', () => { |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
contextSrv.user.isSignedIn = true; |
|
|
|
contextSrv.user.isSignedIn = true; |
|
|
|
setContextSrv(contextSrv); |
|
|
|
setContextSrv(contextSrv); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation, jest.fn()); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation); |
|
|
|
const signInNode = enrichedConfigItems.find((item) => item.id === 'signin'); |
|
|
|
const signInNode = enrichedConfigItems.find((item) => item.id === 'signin'); |
|
|
|
expect(signInNode).toBeDefined(); |
|
|
|
expect(signInNode).toBeDefined(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -80,7 +80,7 @@ describe('enrichConfigItems', () => { |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
contextSrv.user.orgCount = 1; |
|
|
|
contextSrv.user.orgCount = 1; |
|
|
|
setContextSrv(contextSrv); |
|
|
|
setContextSrv(contextSrv); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation, jest.fn()); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation); |
|
|
|
const profileNode = enrichedConfigItems.find((item) => item.id === 'profile'); |
|
|
|
const profileNode = enrichedConfigItems.find((item) => item.id === 'profile'); |
|
|
|
expect(profileNode!.children).toBeUndefined(); |
|
|
|
expect(profileNode!.children).toBeUndefined(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -89,7 +89,7 @@ describe('enrichConfigItems', () => { |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
contextSrv.user.orgCount = 2; |
|
|
|
contextSrv.user.orgCount = 2; |
|
|
|
setContextSrv(contextSrv); |
|
|
|
setContextSrv(contextSrv); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation, jest.fn()); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation); |
|
|
|
const profileNode = enrichedConfigItems.find((item) => item.id === 'profile'); |
|
|
|
const profileNode = enrichedConfigItems.find((item) => item.id === 'profile'); |
|
|
|
expect(profileNode!.children).toContainEqual( |
|
|
|
expect(profileNode!.children).toContainEqual( |
|
|
|
expect.objectContaining({ |
|
|
|
expect.objectContaining({ |
|
|
|
@ -101,7 +101,7 @@ describe('enrichConfigItems', () => { |
|
|
|
it('enhances the help node with extra child links', () => { |
|
|
|
it('enhances the help node with extra child links', () => { |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
const contextSrv = new ContextSrv(); |
|
|
|
setContextSrv(contextSrv); |
|
|
|
setContextSrv(contextSrv); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation, jest.fn()); |
|
|
|
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation); |
|
|
|
const helpNode = enrichedConfigItems.find((item) => item.id === 'help'); |
|
|
|
const helpNode = enrichedConfigItems.find((item) => item.id === 'help'); |
|
|
|
expect(helpNode!.children).toContainEqual( |
|
|
|
expect(helpNode!.children).toContainEqual( |
|
|
|
expect.objectContaining({ |
|
|
|
expect.objectContaining({ |
|
|
|
|