mirror of
https://github.com/multica-ai/multica.git
synced 2026-06-17 03:38:32 +02:00
fix: CI test failures
- Add React import back in FileTreeComponent.test.tsx (required for JSX) - Fix isValidPath to recognize Windows paths on non-Windows platforms Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import * as path from 'path'
|
||||
|
||||
// Regex to match Windows absolute paths (e.g., C:\Users or D:\)
|
||||
const WINDOWS_ABSOLUTE_PATH_REGEX = /^[a-zA-Z]:[/\\]/
|
||||
|
||||
export function isValidPath(inputPath: string): boolean {
|
||||
if (!path.isAbsolute(inputPath)) {
|
||||
// Check for absolute path (POSIX or Windows)
|
||||
const isAbsolute = path.isAbsolute(inputPath) || WINDOWS_ABSOLUTE_PATH_REGEX.test(inputPath)
|
||||
if (!isAbsolute) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* @vitest-environment jsdom
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { act } from 'react'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { createRoot, type Root } from 'react-dom/client'
|
||||
|
||||
Reference in New Issue
Block a user