fix(grid): dim null cells consistently without type colors
This commit is contained in:
2 files changed
+15
-10
No files matched your search
@@ -98,15 +98,20 @@ describe("data grid cell text visual priority", () => {
|
||||
expect(resolveDataGridCellTextRole({ ...ordinaryInteger, ...override })).toBe("muted");
|
||||
});
|
||||
|
||||
it("keeps NULL muted when type colors are disabled", () => {
|
||||
expect(resolveDataGridCellTextRole({ ...ordinaryInteger, colorizeTypes: false, isNull: true })).toBe("muted");
|
||||
});
|
||||
|
||||
it("uses a neutral foreground on editable DOM hover surfaces", () => {
|
||||
expect(dataGridSource).toContain("'hover:bg-gray-200 hover:text-foreground dark:hover:bg-gray-800':");
|
||||
expect(dataGridSource).toContain("'cursor-text hover:bg-gray-200 hover:text-foreground dark:hover:bg-gray-800':");
|
||||
});
|
||||
|
||||
it("keeps Mongo BSON null muted when type colors are disabled", () => {
|
||||
const mongoNullPriority = 'const isMongoDocumentNull = props.mongoCollectionGrid === true && value === MONGO_DOCUMENT_GRID_NULL;\n if (isMongoDocumentNull) return "text-muted-foreground italic";\n if (!colorizeDataGridCellTypes.value) return "text-foreground";';
|
||||
|
||||
expect(dataGridSource.split(mongoNullPriority)).toHaveLength(3);
|
||||
it("checks NULL before applying the optional type-color setting", () => {
|
||||
expect(dataGridSource).toContain("function gridCellTextColorClass(item: RowItem, actualColIdx: number, visibleColIdx: number): string {\n const value = item.data[actualColIdx];");
|
||||
expect(dataGridSource).toContain("function transposeCellTextColorClass(recordIndex: number, actualColIdx: number): string {\n const item = displayItems.value[recordIndex];");
|
||||
expect(dataGridSource).not.toContain('function gridCellTextColorClass(item: RowItem, actualColIdx: number, visibleColIdx: number): string {\n if (!colorizeDataGridCellTypes.value) return "text-foreground";');
|
||||
expect(dataGridSource).not.toContain('function transposeCellTextColorClass(recordIndex: number, actualColIdx: number): string {\n if (!colorizeDataGridCellTypes.value) return "text-foreground";');
|
||||
});
|
||||
|
||||
it("places data-grid type selectors in the components layer", () => {
|
||||
|
||||
Reference in new issue
Block a user