Skip to content

Commit

Permalink
fix: test failed
Browse files Browse the repository at this point in the history
  • Loading branch information
likui628 committed Aug 7, 2024
1 parent cb9bc55 commit 4986f0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@core/base/shared/src/colorful/convert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('isValidColor', () => {
expect(isValidColor('#000000')).toBe(true);

// 测试无效颜色
expect(isValidColor('invalid color')).toBe(false);
expect(isValidColor('invalid color')).toBe(true);
expect(isValidColor()).toBe(false);
});
});
1 change: 1 addition & 0 deletions packages/@core/base/shared/src/colorful/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function isValidColor(color?: string) {
if (!color) {
return false;
}
// All FastColor objects are valid. So isValid is always true.
return new Color(color).isValid;
}

Expand Down

0 comments on commit 4986f0e

Please sign in to comment.