Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Shift + Tab contextual help inspector tooltip regression #16343

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions galata/test/jupyterlab/inspector-tooltip.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { expect, test } from '@jupyterlab/galata';

const fileName = 'notebook.ipynb';
const TOOLTIP_SELECTOR = '.jp-Tooltip';

test.describe('Inspector (contextual help) tooltip', () => {
test.beforeEach(async ({ page }) => {
await page.notebook.createNew(fileName);
});

test('Should show up on Shift + Tab', async ({ page }) => {
await page.notebook.setCell(0, 'code', 'int');
await page.notebook.enterCellEditingMode(0);
// Ensure the cursor is at the end of the cell, after "int"
await page.keyboard.press('End');
// Ensure kernel is ready
await page.locator('text=| Idle').waitFor();
const tooltip = page.locator(TOOLTIP_SELECTOR);
// There should be no tooltip yet
await expect(tooltip).toHaveCount(0);
// Invoke the tooltip
await page.keyboard.press('Shift+Tab');
// There should be a tooltip now
await expect(tooltip).toHaveCount(1);
await expect(tooltip).toContainText('int');
});
});
2 changes: 1 addition & 1 deletion packages/codemirror/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export namespace StateCommands {
dispatch: (transaction: Transaction) => void;
}): boolean {
if (target.dom.closest(TOOLTIP_OPENER_SELECTOR)) {
return true;
return false;
}
return indentLess(target);
}
Expand Down
Loading