Skip to content

Commit

Permalink
Fix: Missing return statement (#2507)
Browse files Browse the repository at this point in the history
  • Loading branch information
Onokaev authored Apr 7, 2023
1 parent 3622b32 commit 557db19
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/views/query-runner/request/permissions/TabList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const TabList = ({ columns, classes, renderItemColumn, renderDetailsHeader, maxH
}

if(permissions.length === 0){
displayNoPermissionsFoundMessage()
return displayNoPermissionsFoundMessage();
}

return (
Expand Down
11 changes: 11 additions & 0 deletions src/tests/ui/anonymous-experiences/request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,17 @@ test.describe('Permissions', () => {
expect(await page.screenshot()).toMatchSnapshot();
const DirectoryPermission = page.locator('div[role="gridcell"]:has-text("Directory.Read.AllDirectory.Read.All")');
expect(DirectoryPermission).toBeDefined();
});

test('should show a message for opening permissions panel when permission requested is not available', async () => {
const queryInput = page.locator('[aria-label="Query sample input"]');
await queryInput.click();
queryInput.fill('https://graph.microsoft.com/v1.0/userssssss');
await page.locator('[aria-label="Modify permissions"]').click();
await page.evaluate(() => document.fonts.ready);
await page.waitForTimeout(100);
expect(page.getByText('Permissions for the query are missing on this tab. Sign in to use the Select per')).toBeDefined();

})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ test.describe('Request', () => {
]);
expect(page5.url().indexOf('https://jwt.ms/')).toBeGreaterThan(-1);
})

test('Permissions tab asks user to open permissions panel to view more permissions if missing on the tab', async () => {
const queryInput = authenticatedPage.locator('[aria-label="Query sample input"]');
await queryInput.click();
queryInput.fill('https://graph.microsoft.com/v1.0/userssssss');
await authenticatedPage.locator('[aria-label="Modify permissions"]').click();
await authenticatedPage.evaluate(() => document.fonts.ready);
await authenticatedPage.waitForTimeout(100);
expect(authenticatedPage.getByText('Permissions for the query are missing on this tab. Open the permissions panel to')).toBeDefined();
})
})

test.describe.serial('Profile', () => {
Expand Down

0 comments on commit 557db19

Please sign in to comment.