Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
kazcw committed Jan 24, 2025
1 parent 81f9083 commit 16c69cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions app/gui/integration-test/project-view/graphRenderNodes.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test } from '@playwright/test'
import * as actions from './actions'
import { expect } from './customExpect'
import { mockExpressionUpdate } from './expressionUpdates'
import * as locate from './locate'

test('graph can open and render nodes', async ({ page }) => {
Expand All @@ -16,3 +17,12 @@ test('graph can open and render nodes', async ({ page }) => {
const finalNode = locate.graphNodeByBinding(page, 'final')
await expect(finalNode.locator('.WidgetToken')).toHaveText(['Main', '.', 'func1', 'prod'])
})

test('Component icon indicates evaluation in progress', async ({ page }) => {
await actions.goToGraph(page)

const node = locate.graphNodeByBinding(page, 'final')
await expect(node.locator('.WidgetIcon .LoadingSpinner')).not.toBeVisible()
await mockExpressionUpdate(page, 'final', { payload: { type: 'Pending', progress: 0.1 } })
await expect(node.locator('.WidgetIcon .LoadingSpinner')).toBeVisible()
})
4 changes: 2 additions & 2 deletions app/gui/src/project-view/util/getIconName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export function useDisplayedIcon(
baseIcon: ToValue<Icon | URLString>,
) {
const evaluating = computed(() => {
const status = graphDb.getExpressionInfo(toValue(externalId))?.payload.type
return status === 'Pending' || status === undefined
const payload = graphDb.getExpressionInfo(toValue(externalId))?.payload
return payload?.type === 'Pending' && payload.progress
})
return {
displayedIcon: computed(() => (evaluating.value ? '$evaluating' : toValue(baseIcon))),
Expand Down

0 comments on commit 16c69cc

Please sign in to comment.