Skip to content

Commit 6cb8072

Browse files
committed
Use retry helper for empty cell context menu test
The extension command registers asynchronously even for empty cells, so the retry helper (dismiss and re-open menu) is needed here too. The previous fix incorrectly assumed the command was already registered for empty cells. Signed-off-by: Luciano Resende <lresende@apple.com>
1 parent 1e1cb93 commit 6cb8072

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cypress/tests/codesnippetfromselectedcells.cy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ describe('Code snippet from cells tests', () => {
3131
it('test empty cell', () => {
3232
cy.get('.jp-Notebook').should('have.length', 1);
3333

34-
// For the empty cell, the snippet command is already registered (just disabled).
35-
// No retry helper needed — just rightclick and wait for the menu item.
36-
cy.get('.jp-Cell').first().rightclick();
37-
cy.get('li.lm-Menu-item[data-command="codesnippet:save-as-snippet"]', {
38-
timeout: 10000
39-
}).should('have.class', 'lm-mod-disabled');
34+
// Extension commands register asynchronously — use retry helper
35+
openCellContextMenuWithSnippetItem();
36+
37+
cy.get(
38+
'li.lm-Menu-item[data-command="codesnippet:save-as-snippet"]'
39+
).should('have.class', 'lm-mod-disabled');
4040
});
4141

4242
it('test 1 cell', () => {

0 commit comments

Comments
 (0)