Skip to content

Commit bd0839a

Browse files
committed
chore: Address reviewer comments.
1 parent f1badbb commit bd0839a

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

test/toolboxCategories.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default {
1717
{
1818
type: 'controls_if',
1919
kind: 'block',
20+
id: 'if_block',
2021
},
2122
{
2223
type: 'logic_compare',
@@ -374,6 +375,7 @@ export default {
374375
fields: {
375376
TEXT: '',
376377
},
378+
id: 'text_block',
377379
},
378380
{
379381
type: 'text_join',
@@ -382,6 +384,7 @@ export default {
382384
{
383385
type: 'text_append',
384386
kind: 'block',
387+
id: 'append_text_block',
385388
fields: {
386389
name: 'item',
387390
},

test/webdriverio/test/flyout_test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import {
1111
testFileLocations,
1212
PAUSE_TIME,
1313
tabNavigateForward,
14-
getFocusedBlockType,
1514
keyDown,
1615
tabNavigateBackward,
1716
tabNavigateToWorkspace,
1817
keyRight,
1918
getCurrentFocusNodeId,
19+
getCurrentFocusedBlockId,
2020
} from './test_setup.js';
2121

22-
suite('Toolbox and flyout test', function () {
22+
suite.only('Toolbox and flyout test', function () {
2323
// Clear the workspace and load start blocks
2424
setup(async function () {
2525
this.browser = await testSetup(testFileLocations.BASE);
@@ -46,8 +46,8 @@ suite('Toolbox and flyout test', function () {
4646

4747
// The top block of the category should be automatically selected. See:
4848
// https://github.com/google/blockly/issues/8978.
49-
const blockType = await getFocusedBlockType(this.browser);
50-
chai.assert.strictEqual(blockType, 'controls_if');
49+
const blockId = await getCurrentFocusedBlockId(this.browser);
50+
chai.assert.strictEqual(blockId, 'if_block');
5151
});
5252

5353
test('Tab navigating to toolbox then right arrow key should auto-select first block in flyout', async function () {
@@ -60,8 +60,8 @@ suite('Toolbox and flyout test', function () {
6060

6161
// The top block of the category should be automatically selected. See:
6262
// https://github.com/google/blockly/issues/8978.
63-
const blockType = await getFocusedBlockType(this.browser);
64-
chai.assert.strictEqual(blockType, 'controls_if');
63+
const blockId = await getCurrentFocusedBlockId(this.browser);
64+
chai.assert.strictEqual(blockId, 'if_block');
6565
});
6666

6767
test('Keyboard nav to different toolbox category should auto-select first block', async function () {
@@ -74,8 +74,8 @@ suite('Toolbox and flyout test', function () {
7474
await tabNavigateForward(this.browser);
7575

7676
// The top block of the category should be automatically selected.
77-
const blockType = await getFocusedBlockType(this.browser);
78-
chai.assert.strictEqual(blockType, 'text');
77+
const blockId = await getCurrentFocusedBlockId(this.browser);
78+
chai.assert.strictEqual(blockId, 'text_block');
7979
});
8080

8181
test('Keyboard nav to different toolbox category and block should select different block', async function () {
@@ -90,8 +90,8 @@ suite('Toolbox and flyout test', function () {
9090
await keyDown(this.browser, 2);
9191

9292
// A non-top blockshould be manually selected.
93-
const blockType = await getFocusedBlockType(this.browser);
94-
chai.assert.strictEqual(blockType, 'text_append');
93+
const blockId = await getCurrentFocusedBlockId(this.browser);
94+
chai.assert.strictEqual(blockId, 'append_text_block');
9595
});
9696

9797
test('Tab navigate away from toolbox restores focus to initial element', async function () {
@@ -196,8 +196,8 @@ suite('Toolbox and flyout test', function () {
196196

197197
// The previously selected block should be retained upon returning. See:
198198
// https://github.com/google/blockly/issues/8965#issuecomment-2900479280.
199-
const blockType = await getFocusedBlockType(this.browser);
200-
chai.assert.strictEqual(blockType, 'p5_draw');
199+
const blockId = await getCurrentFocusedBlockId(this.browser);
200+
chai.assert.strictEqual(blockId, 'p5_draw_1');
201201
});
202202

203203
test('Clicking outside Blockly with focused toolbox closes the flyout', async function () {

0 commit comments

Comments
 (0)