|
|
@@ -1,50 +0,0 @@
|
|
|
-// ConstructionHome template structure test
|
|
|
-// TDD: Verify TopBar usage with left/right slots
|
|
|
-
|
|
|
-import { describe, it, expect } from 'vitest'
|
|
|
-import { mount } from '@vue/test-utils'
|
|
|
-import ConstructionHome from './ConstructionHome.vue'
|
|
|
-
|
|
|
-// Since we don't have a full test runner setup, we'll create a simple
|
|
|
-// structural verification test that can be run manually
|
|
|
-
|
|
|
-function verifyTemplateStructure(): boolean {
|
|
|
- const fs = require('fs')
|
|
|
- const path = require('path')
|
|
|
-
|
|
|
- const filePath = path.join(__dirname, 'ConstructionHome.vue')
|
|
|
- const content = fs.readFileSync(filePath, 'utf-8')
|
|
|
-
|
|
|
- const checks = {
|
|
|
- hasTopBarImport: content.includes("import TopBar from '@/components/common/TopBar.vue'"),
|
|
|
- usesTopBarComponent: content.includes('<TopBar'),
|
|
|
- hasTitleProp: content.includes('title=""'),
|
|
|
- hasLeftSlot: content.includes('<template #left>'),
|
|
|
- hasRightSlot: content.includes('<template #right>'),
|
|
|
- noStatusBarImport: !content.includes("import StatusBar from '@/components/common/StatusBar.vue'"),
|
|
|
- noStatusBarUsage: !content.includes('<StatusBar />'),
|
|
|
- hasNotificationButton: content.includes('goToNotification'),
|
|
|
- hasUserInfo: content.includes('张师傅'),
|
|
|
- hasPersonIcon: content.includes('uniui-person-filled'),
|
|
|
- hasNotificationIcon: content.includes('uniui-notification-filled')
|
|
|
- }
|
|
|
-
|
|
|
- console.log('\n=== ConstructionHome Template Structure Verification ===\n')
|
|
|
-
|
|
|
- let allPass = true
|
|
|
- for (const [check, passed] of Object.entries(checks)) {
|
|
|
- const status = passed ? 'PASS' : 'FAIL'
|
|
|
- console.log(` ${check}: ${status}`)
|
|
|
- if (!passed) allPass = false
|
|
|
- }
|
|
|
-
|
|
|
- console.log(`\n${allPass ? '✓ All checks PASSED' : '✗ Some checks FAILED'}`)
|
|
|
- return allPass
|
|
|
-}
|
|
|
-
|
|
|
-// Run the test
|
|
|
-if (require.main === module) {
|
|
|
- verifyTemplateStructure()
|
|
|
-}
|
|
|
-
|
|
|
-export { verifyTemplateStructure }
|