Skip to content

Commit

Permalink
Fix doc table header tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weltenwort committed Jun 21, 2017
1 parent 57a536d commit f19e266
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/ui/public/doc_table/__tests__/lib/rows_headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Doc Table', function () {

it('should create a time column if the timefield is defined', function () {
const childElems = parentElem.find(elemType);
expect(childElems.length).to.be(2);
expect(childElems.length).to.be(1);
});

it('should be able to add and remove columns', function () {
Expand All @@ -61,28 +61,28 @@ describe('Doc Table', function () {
$parentScope.columns = ['bytes'];
parentElem.scope().$digest();
childElems = parentElem.find(elemType);
expect(childElems.length).to.be(3);
expect($(childElems[2]).text()).to.contain('bytes');
expect(childElems.length).to.be(2);
expect($(childElems[1]).text()).to.contain('bytes');

$parentScope.columns = ['bytes', 'request_body'];
parentElem.scope().$digest();
childElems = parentElem.find(elemType);
expect(childElems.length).to.be(4);
expect($(childElems[3]).text()).to.contain('request_body');
expect(childElems.length).to.be(3);
expect($(childElems[2]).text()).to.contain('request_body');

$parentScope.columns = ['request_body'];
parentElem.scope().$digest();
childElems = parentElem.find(elemType);
expect(childElems.length).to.be(3);
expect($(childElems[2]).text()).to.contain('request_body');
expect(childElems.length).to.be(2);
expect($(childElems[1]).text()).to.contain('request_body');
});

it('should create only the toggle column if there is no timeField', function () {
delete parentElem.scope().indexPattern.timeFieldName;
parentElem.scope().$digest();

const childElems = parentElem.find(elemType);
expect(childElems.length).to.be(1);
expect(childElems.length).to.be(0);
});

};
Expand Down Expand Up @@ -117,7 +117,7 @@ describe('Doc Table', function () {
});

describe('adding and removing columns', function () {
columnTests('th', $elem);
columnTests('[data-test-subj~="docTableHeaderField"]', $elem);
});

describe('cycleSortOrder function', function () {
Expand Down Expand Up @@ -252,7 +252,7 @@ describe('Doc Table', function () {
});

describe('adding and removing columns', function () {
columnTests('td', $elem);
columnTests('[data-test-subj~="docTableField"]', $elem);
});

describe('details row', function () {
Expand Down

0 comments on commit f19e266

Please sign in to comment.