removed perspective intersection observer

This commit is contained in:
Jan Prochazka
2022-07-31 15:28:04 +02:00
parent fe31cfb552
commit bf51f45934
6 changed files with 173 additions and 77 deletions

View File

@@ -12,13 +12,17 @@ test('test flat view', () => {
const root = new PerspectiveTableNode(artistTable, chinookDbInfo, createPerspectiveConfig(), null, null, null, null);
const display = new PerspectiveDisplay(root, artistDataFlat);
console.log(display.rows);
expect(display.rows.length).toEqual(5);
// console.log(display.loadIndicatorsCounts);
// console.log(display.rows);
expect(display.rows.length).toEqual(4);
expect(display.rows[0]).toEqual(
expect.objectContaining({
rowData: ['AC/DC'],
})
);
expect(display.loadIndicatorsCounts).toEqual({
Artist: 4,
});
});
test('test one level nesting', () => {
@@ -34,8 +38,9 @@ test('test one level nesting', () => {
);
const display = new PerspectiveDisplay(root, artistDataAlbum);
console.log(display.rows);
expect(display.rows.length).toEqual(7);
console.log(display.loadIndicatorsCounts);
// console.log(display.rows);
expect(display.rows.length).toEqual(6);
expect(display.rows[0]).toEqual(
expect.objectContaining({
rowData: ['AC/DC', 'For Those About To Rock We Salute You'],
@@ -63,6 +68,11 @@ test('test one level nesting', () => {
rowSpans: [1, 1],
})
);
expect(display.loadIndicatorsCounts).toEqual({
Artist: 6,
'Artist.Album': 6,
});
});
test('test two level nesting', () => {
@@ -79,7 +89,7 @@ test('test two level nesting', () => {
const display = new PerspectiveDisplay(root, artistDataAlbumTrack);
console.log(display.rows);
expect(display.rows.length).toEqual(9);
expect(display.rows.length).toEqual(8);
expect(display.rows[0]).toEqual(
expect.objectContaining({
rowData: ['AC/DC', 'For Those About To Rock We Salute You', 'For Those About To Rock (We Salute You)'],

View File

@@ -1,55 +1,56 @@
export default [
{
"ArtistId": 1,
"Name": "AC/DC",
"Album": [
{
"Title": "For Those About To Rock We Salute You",
"ArtistId": 1
},
{
"Title": "Let There Be Rock",
"ArtistId": 1
}
]
},
{
"ArtistId": 2,
"Name": "Accept",
"Album": [
{
"Title": "Balls to the Wall",
"ArtistId": 2
},
{
"Title": "Restless and Wild",
"ArtistId": 2
}
]
},
{
"ArtistId": 3,
"Name": "Aerosmith",
"Album": [
{
"Title": "Big Ones",
"ArtistId": 3
}
]
},
{
"ArtistId": 4,
"Name": "Alanis Morissette",
"Album": [
{
"Title": "Jagged Little Pill",
"ArtistId": 4
}
]
},
{
"incompleteRowsIndicator": [
"Artist"
]
}
]
{
ArtistId: 1,
Name: 'AC/DC',
Album: [
{
Title: 'For Those About To Rock We Salute You',
ArtistId: 1,
},
{
Title: 'Let There Be Rock',
ArtistId: 1,
},
],
},
{
ArtistId: 2,
Name: 'Accept',
Album: [
{
Title: 'Balls to the Wall',
ArtistId: 2,
},
{
Title: 'Restless and Wild',
ArtistId: 2,
},
],
},
{
ArtistId: 3,
Name: 'Aerosmith',
Album: [
{
Title: 'Big Ones',
ArtistId: 3,
},
],
},
{
ArtistId: 4,
Name: 'Alanis Morissette',
Album: [
{
Title: 'Jagged Little Pill',
ArtistId: 4,
},
{
incompleteRowsIndicator: ['Artist.Album'],
},
],
},
{
incompleteRowsIndicator: ['Artist'],
},
];