Skip to content

Commit 16c69cc

Browse files
committed
Review
1 parent 81f9083 commit 16c69cc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/gui/integration-test/project-view/graphRenderNodes.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { test } from '@playwright/test'
22
import * as actions from './actions'
33
import { expect } from './customExpect'
4+
import { mockExpressionUpdate } from './expressionUpdates'
45
import * as locate from './locate'
56

67
test('graph can open and render nodes', async ({ page }) => {
@@ -16,3 +17,12 @@ test('graph can open and render nodes', async ({ page }) => {
1617
const finalNode = locate.graphNodeByBinding(page, 'final')
1718
await expect(finalNode.locator('.WidgetToken')).toHaveText(['Main', '.', 'func1', 'prod'])
1819
})
20+
21+
test('Component icon indicates evaluation in progress', async ({ page }) => {
22+
await actions.goToGraph(page)
23+
24+
const node = locate.graphNodeByBinding(page, 'final')
25+
await expect(node.locator('.WidgetIcon .LoadingSpinner')).not.toBeVisible()
26+
await mockExpressionUpdate(page, 'final', { payload: { type: 'Pending', progress: 0.1 } })
27+
await expect(node.locator('.WidgetIcon .LoadingSpinner')).toBeVisible()
28+
})

app/gui/src/project-view/util/getIconName.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ export function useDisplayedIcon(
8383
baseIcon: ToValue<Icon | URLString>,
8484
) {
8585
const evaluating = computed(() => {
86-
const status = graphDb.getExpressionInfo(toValue(externalId))?.payload.type
87-
return status === 'Pending' || status === undefined
86+
const payload = graphDb.getExpressionInfo(toValue(externalId))?.payload
87+
return payload?.type === 'Pending' && payload.progress
8888
})
8989
return {
9090
displayedIcon: computed(() => (evaluating.value ? '$evaluating' : toValue(baseIcon))),

0 commit comments

Comments
 (0)