Skip to content

Conversation

christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Sep 14, 2025

Summary

Added comprehensive test suite for WidgetTreeSelect component with 32 test cases covering tree navigation, selection modes, and edge cases.

Changes

Review Focus

Test coverage for deeply nested tree structures, special character handling, and proper Vue event emission patterns. Verify mock widget creation follows existing patterns.

┆Issue is synchronized with this Notion page by Unito

@christian-byrne christian-byrne requested a review from a team as a code owner September 14, 2025 04:50
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Sep 14, 2025
Copy link

github-actions bot commented Sep 14, 2025

🎭 Playwright Test Results

All tests passed!

⏰ Completed at: 09/16/2025, 09:33:17 PM UTC

📈 Summary

  • Total Tests: 450
  • Passed: 421 ✅
  • Failed: 0
  • Flaky: 0
  • Skipped: 29 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 414 / ❌ 0 / ⚠️ 0 / ⏭️ 29
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 4 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@christian-byrne christian-byrne force-pushed the vue-nodes/test/tree-select-widget-test branch from 502da31 to cac6599 Compare September 15, 2025 03:45
DrJKL
DrJKL previously approved these changes Sep 16, 2025
Copy link
Contributor

@DrJKL DrJKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concern as in the other one, but it's probably fine to just prune later.

Comment on lines 11 to 18
type TreeNode = {
key: string
label?: string
data?: unknown
children?: TreeNode[]
leaf?: boolean
selectable?: boolean
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as in the imagecompare PR, is this type available from within the component code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exported TreeNode type from component in 45dfb55

Comment on lines 21 to 120
const createMockWidget = (
value: WidgetValue = null,
options: Partial<TreeSelectProps> = {},
callback?: (value: WidgetValue) => void
): SimplifiedWidget<WidgetValue> => ({
name: 'test_treeselect',
type: 'object',
value,
options,
callback
})

const mountComponent = (
widget: SimplifiedWidget<WidgetValue>,
modelValue: WidgetValue,
readonly = false
) => {
return mount(WidgetTreeSelect, {
global: {
plugins: [PrimeVue],
components: { TreeSelect }
},
props: {
widget,
modelValue,
readonly
}
})
}

const setTreeSelectValueAndEmit = async (
wrapper: ReturnType<typeof mount>,
value: unknown
) => {
const treeSelect = wrapper.findComponent({ name: 'TreeSelect' })
await treeSelect.vm.$emit('update:modelValue', value)
return treeSelect
}

const createTreeData = (): TreeNode[] => [
{
key: '0',
label: 'Documents',
data: 'Documents Folder',
children: [
{
key: '0-0',
label: 'Work',
data: 'Work Folder',
children: [
{
key: '0-0-0',
label: 'Expenses.doc',
data: 'Expenses Document',
leaf: true
},
{
key: '0-0-1',
label: 'Resume.doc',
data: 'Resume Document',
leaf: true
}
]
},
{
key: '0-1',
label: 'Home',
data: 'Home Folder',
children: [
{
key: '0-1-0',
label: 'Invoices.txt',
data: 'Invoices for this month',
leaf: true
}
]
}
]
},
{
key: '1',
label: 'Events',
data: 'Events Folder',
children: [
{ key: '1-0', label: 'Meeting', data: 'Meeting', leaf: true },
{
key: '1-1',
label: 'Product Launch',
data: 'Product Launch',
leaf: true
},
{
key: '1-2',
label: 'Report Review',
data: 'Report Review',
leaf: true
}
]
}
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Please move to module scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to module scope in 4674a7d

@christian-byrne christian-byrne merged commit 71ca28a into main Sep 16, 2025
21 checks passed
@christian-byrne christian-byrne deleted the vue-nodes/test/tree-select-widget-test branch September 16, 2025 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:testing area:vue-migration size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants