updating tests to changes in Sample
This commit is contained in:
Родитель
76981198e1
Коммит
0d2b1b0934
|
@ -32,6 +32,17 @@ describe('SplitPanel', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Render inside a Card (+ Table inside a Card)', () => {
|
it('Render inside a Card (+ Table inside a Card)', () => {
|
||||||
|
dataSources['samples'].action.updateDependencies({
|
||||||
|
groups: [
|
||||||
|
{ title: "value1", subtitle: "subvalue1", count: 60 },
|
||||||
|
{ title: "value2", subtitle: "subvalue2", count: 60 },
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
{ id: "value1", count: 60 },
|
||||||
|
{ id: "value2", count: 10 },
|
||||||
|
{ id: "value3", count: 30 }
|
||||||
|
]
|
||||||
|
});
|
||||||
let card = TestUtils.scryRenderedComponentsWithType(splitpanel, Card);
|
let card = TestUtils.scryRenderedComponentsWithType(splitpanel, Card);
|
||||||
expect(card).toHaveLength(2);
|
expect(card).toHaveLength(2);
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,6 +30,9 @@ describe('Table', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Render inside a Card', () => {
|
it('Render inside a Card', () => {
|
||||||
|
dataSources['samples'].action.updateDependencies({
|
||||||
|
'table-values': dataSources['samples'].store.state['values']
|
||||||
|
});
|
||||||
let card = TestUtils.scryRenderedComponentsWithType(table, Card);
|
let card = TestUtils.scryRenderedComponentsWithType(table, Card);
|
||||||
expect(card.length).toBe(1);
|
expect(card.length).toBe(1);
|
||||||
});
|
});
|
||||||
|
@ -46,7 +49,7 @@ describe('Table', () => {
|
||||||
|
|
||||||
it('Rows == 0', () => {
|
it('Rows == 0', () => {
|
||||||
dataSources['samples'].action.updateDependencies({
|
dataSources['samples'].action.updateDependencies({
|
||||||
values: []
|
'table-values': []
|
||||||
});
|
});
|
||||||
let rows = TestUtils.scryRenderedComponentsWithType(table, TableRow);
|
let rows = TestUtils.scryRenderedComponentsWithType(table, TableRow);
|
||||||
expect(rows.length).toBe(1);
|
expect(rows.length).toBe(1);
|
||||||
|
|
|
@ -6,17 +6,7 @@ dashboard.dataSources.push(
|
||||||
id: "samples",
|
id: "samples",
|
||||||
type: "Sample",
|
type: "Sample",
|
||||||
params: {
|
params: {
|
||||||
samples: {
|
samples: { }
|
||||||
groups: [
|
|
||||||
{ title: "value1", subtitle: "subvalue1", count: 60 },
|
|
||||||
{ title: "value2", subtitle: "subvalue2", count: 60 },
|
|
||||||
],
|
|
||||||
values: [
|
|
||||||
{ id: "value1", count: 60 },
|
|
||||||
{ id: "value2", count: 10 },
|
|
||||||
{ id: "value3", count: 30 }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,7 +8,7 @@ dashboard.elements.push({
|
||||||
size: { w: 1, h: 1 },
|
size: { w: 1, h: 1 },
|
||||||
title: 'Table',
|
title: 'Table',
|
||||||
subtitle: 'Table',
|
subtitle: 'Table',
|
||||||
dependencies: { values: 'samples:values' },
|
dependencies: { values: 'samples:table-values' },
|
||||||
props: {
|
props: {
|
||||||
cols: [
|
cols: [
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче