mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 11:30:15 +00:00
Fix infrastructure table responsive resizing
This commit is contained in:
parent
d29adbf1ee
commit
af2db1f63c
7 changed files with 185 additions and 12 deletions
|
|
@ -13,7 +13,10 @@ import {
|
|||
getUnifiedResourceTableSortIndicator,
|
||||
getUnifiedSources,
|
||||
getVisibleHostTableItems,
|
||||
isUnifiedResourceTableColumnVisible,
|
||||
normalizeUnifiedResourceTableLayoutWidth,
|
||||
shouldShowUnifiedResourceHostTable,
|
||||
shouldUseUnifiedResourceTableMobileLayout,
|
||||
} from '@/components/Infrastructure/unifiedResourceTableStateModel';
|
||||
|
||||
const makeResource = (id: string, overrides: Partial<Resource> = {}): Resource =>
|
||||
|
|
@ -131,6 +134,18 @@ describe('unifiedResourceTableStateModel', () => {
|
|||
expect(shouldShowUnifiedResourceHostTable(3, 2)).toBe(true);
|
||||
});
|
||||
|
||||
it('derives infrastructure table breakpoints from the measured table surface width', () => {
|
||||
expect(normalizeUnifiedResourceTableLayoutWidth(820.4)).toBe(820);
|
||||
expect(normalizeUnifiedResourceTableLayoutWidth(null, 700)).toBe(700);
|
||||
expect(shouldUseUnifiedResourceTableMobileLayout(767)).toBe(true);
|
||||
expect(shouldUseUnifiedResourceTableMobileLayout(768)).toBe(false);
|
||||
expect(isUnifiedResourceTableColumnVisible('primary', 700)).toBe(true);
|
||||
expect(isUnifiedResourceTableColumnVisible('secondary', 1119)).toBe(false);
|
||||
expect(isUnifiedResourceTableColumnVisible('secondary', 1120)).toBe(true);
|
||||
expect(isUnifiedResourceTableColumnVisible('supplementary', 1359)).toBe(false);
|
||||
expect(isUnifiedResourceTableColumnVisible('supplementary', 1360)).toBe(true);
|
||||
});
|
||||
|
||||
it('reads unified source tags from platform data without hook state', () => {
|
||||
expect(getUnifiedSources(makeResource('a', { platformData: { sources: ['proxmox', 'agent'] } }))).toEqual([
|
||||
'proxmox',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue