-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix showHoverRows when zebra rows is disabled and release version patch
- Loading branch information
1 parent
0ad2601
commit 3e34705
Showing
7 changed files
with
315 additions
and
2 deletions.
There are no files selected for viewing
123 changes: 123 additions & 0 deletions
123
examples/src/pages/tests/table/props/data/basic-no-zebra-no-hover.page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import * as React from 'react'; | ||
|
||
import { | ||
InfiniteTable, | ||
DataSource, | ||
InfiniteTableColumn, | ||
} from '@infinite-table/infinite-react'; | ||
import { CarSale } from '@examples/datasets/CarSale'; | ||
|
||
const carsales: CarSale[] = [ | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 2WD', | ||
year: 2010, | ||
sales: 15, | ||
color: 'red', | ||
id: 0, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 4WD', | ||
year: 2007, | ||
sales: 1, | ||
color: 'red', | ||
id: 1, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 4WD', | ||
year: 2008, | ||
sales: 2, | ||
color: 'magenta', | ||
id: 2, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 4WD', | ||
year: 2009, | ||
sales: 136, | ||
color: 'blue', | ||
id: 3, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 4WD', | ||
year: 2010, | ||
color: 'blue', | ||
sales: 30, | ||
id: 4, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'TSX', | ||
year: 2009, | ||
sales: 14, | ||
color: 'yellow', | ||
id: 5, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'TSX', | ||
year: 2010, | ||
sales: 14, | ||
color: 'red', | ||
id: 6, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Audi', | ||
model: 'A3', | ||
year: 2009, | ||
sales: 2, | ||
color: 'magenta', | ||
id: 7, | ||
}, | ||
]; | ||
|
||
(globalThis as any).carsales = carsales; | ||
|
||
const columns: Record<string, InfiniteTableColumn<CarSale>> = { | ||
make: { field: 'make' }, | ||
model: { field: 'model' }, | ||
|
||
category: { | ||
field: 'category', | ||
}, | ||
count: { | ||
field: 'sales', | ||
}, | ||
year: { | ||
field: 'year', | ||
type: 'number', | ||
}, | ||
}; | ||
|
||
export default function DataTestPage() { | ||
return ( | ||
<React.StrictMode> | ||
<DataSource<CarSale> data={carsales} primaryKey="id"> | ||
<InfiniteTable<CarSale> | ||
domProps={{ | ||
style: { | ||
margin: '5px', | ||
height: 900, | ||
border: '1px solid gray', | ||
position: 'relative', | ||
}, | ||
}} | ||
showHoverRows={false} | ||
showZebraRows={false} | ||
columns={columns} | ||
/> | ||
</DataSource> | ||
</React.StrictMode> | ||
); | ||
} |
30 changes: 30 additions & 0 deletions
30
examples/src/pages/tests/table/props/data/basic-no-zebra-no-hover.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { test, expect } from '@testing'; | ||
|
||
export default test.describe | ||
.parallel('Hover rows when zebra is off and hover is off', () => { | ||
test('', async ({ page, tableModel }) => { | ||
await page.waitForInfinite(); | ||
|
||
const row1 = tableModel.withCell({ | ||
rowIndex: 0, | ||
colIndex: 0, | ||
}); | ||
|
||
const row2 = tableModel.withCell({ | ||
rowIndex: 1, | ||
colIndex: 0, | ||
}); | ||
|
||
const bg1row1 = await row1.getComputedStyleProperty('background-color'); | ||
|
||
await row1.getLocator().hover(); | ||
|
||
const bg2row1 = await row1.getComputedStyleProperty('background-color'); | ||
|
||
expect(bg2row1).toEqual(bg1row1); | ||
|
||
const bg1row2 = await row2.getComputedStyleProperty('background-color'); | ||
|
||
expect(bg1row2).toEqual(bg1row1); | ||
}); | ||
}); |
123 changes: 123 additions & 0 deletions
123
examples/src/pages/tests/table/props/data/basic-no-zebra.page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import * as React from 'react'; | ||
|
||
import { | ||
InfiniteTable, | ||
DataSource, | ||
InfiniteTableColumn, | ||
} from '@infinite-table/infinite-react'; | ||
import { CarSale } from '@examples/datasets/CarSale'; | ||
|
||
const carsales: CarSale[] = [ | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 2WD', | ||
year: 2010, | ||
sales: 15, | ||
color: 'red', | ||
id: 0, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 4WD', | ||
year: 2007, | ||
sales: 1, | ||
color: 'red', | ||
id: 1, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 4WD', | ||
year: 2008, | ||
sales: 2, | ||
color: 'magenta', | ||
id: 2, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 4WD', | ||
year: 2009, | ||
sales: 136, | ||
color: 'blue', | ||
id: 3, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'RDX 4WD', | ||
year: 2010, | ||
color: 'blue', | ||
sales: 30, | ||
id: 4, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'TSX', | ||
year: 2009, | ||
sales: 14, | ||
color: 'yellow', | ||
id: 5, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Acura', | ||
model: 'TSX', | ||
year: 2010, | ||
sales: 14, | ||
color: 'red', | ||
id: 6, | ||
}, | ||
{ | ||
category: '1 - Category 1 Truck', | ||
make: 'Audi', | ||
model: 'A3', | ||
year: 2009, | ||
sales: 2, | ||
color: 'magenta', | ||
id: 7, | ||
}, | ||
]; | ||
|
||
(globalThis as any).carsales = carsales; | ||
|
||
const columns: Record<string, InfiniteTableColumn<CarSale>> = { | ||
make: { field: 'make' }, | ||
model: { field: 'model' }, | ||
|
||
category: { | ||
field: 'category', | ||
}, | ||
count: { | ||
field: 'sales', | ||
}, | ||
year: { | ||
field: 'year', | ||
type: 'number', | ||
}, | ||
}; | ||
|
||
export default function DataTestPage() { | ||
return ( | ||
<React.StrictMode> | ||
<DataSource<CarSale> data={carsales} primaryKey="id"> | ||
<InfiniteTable<CarSale> | ||
domProps={{ | ||
style: { | ||
margin: '5px', | ||
height: 900, | ||
border: '1px solid gray', | ||
position: 'relative', | ||
}, | ||
}} | ||
showHoverRows={true} | ||
showZebraRows={false} | ||
columns={columns} | ||
/> | ||
</DataSource> | ||
</React.StrictMode> | ||
); | ||
} |
29 changes: 29 additions & 0 deletions
29
examples/src/pages/tests/table/props/data/basic-no-zebra.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { test, expect } from '@testing'; | ||
|
||
export default test.describe.parallel('Hover rows when zebra is off', () => { | ||
test('', async ({ page, tableModel }) => { | ||
await page.waitForInfinite(); | ||
|
||
const row1 = tableModel.withCell({ | ||
rowIndex: 0, | ||
colIndex: 0, | ||
}); | ||
|
||
const row2 = tableModel.withCell({ | ||
rowIndex: 1, | ||
colIndex: 0, | ||
}); | ||
|
||
const bg1row1 = await row1.getComputedStyleProperty('background-color'); | ||
|
||
await row1.getLocator().hover(); | ||
|
||
const bg2row1 = await row1.getComputedStyleProperty('background-color'); | ||
|
||
expect(bg2row1).not.toEqual(bg1row1); | ||
|
||
const bg1row2 = await row2.getComputedStyleProperty('background-color'); | ||
|
||
expect(bg1row2).toEqual(bg1row1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters