Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4820 from sirensolutions/issue-4793
Browse files Browse the repository at this point in the history
WIP jquery and moment versions were bumped
  • Loading branch information
szydan committed Mar 22, 2018
2 parents 10f4485 + b804886 commit afc5cb0
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 76 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"jade": "1.11.0",
"jade-loader": "0.7.1",
"joi": "10.4.1",
"jquery": "2.2.4",
"jquery": "^3.3.1",
"js-yaml": "3.4.1",
"json-loader": "0.5.3",
"json-stringify-safe": "5.0.1",
Expand All @@ -161,8 +161,8 @@
"lodash": "3.10.1",
"minimatch": "2.0.10",
"mkdirp": "0.5.1",
"moment": "2.13.0",
"moment-timezone": "0.5.4",
"moment": "^2.20.1",
"moment-timezone": "^0.5.14",
"ngreact": "0.3.0",
"no-ui-slider": "1.2.0",
"node-fetch": "1.3.2",
Expand Down
10 changes: 5 additions & 5 deletions src/core_plugins/table_vis/public/__tests__/_table_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ describe('Integration', function () {
init(new OneRangeVis(), fixtures.oneRangeBucket);

const $atg = $el.find('kbn-agg-table-group').first();
expect($atg.size()).to.be(1);
expect($atg.length).to.be(1);
expect($atg.attr('group')).to.be('tableGroups');
expect($atg.isolateScope().group).to.be($atg.scope().tableGroups);
});

it('displays an error if the search had no hits', function () {
init(new OneRangeVis(), { hits: { total: 0, hits: [] } });

expect($el.find('kbn-agg-table-group').size()).to.be(0);
expect($el.find('kbn-agg-table-group').length).to.be(0);

const $err = $el.find('.table-vis-error');
expect($err.size()).to.be(1);
expect($err.length).to.be(1);
expect($err.text().trim()).to.be('No results found');
});

Expand All @@ -125,10 +125,10 @@ describe('Integration', function () {

init(new ThreeTermVis(visParams), resp);

expect($el.find('kbn-agg-table-group').size()).to.be(0);
expect($el.find('kbn-agg-table-group').length).to.be(0);

const $err = $el.find('.table-vis-error');
expect($err.size()).to.be(1);
expect($err.length).to.be(1);
expect($err.text().trim()).to.be('No results found');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('tooltipFormatter', function () {
const event = _.cloneDeep(baseEvent);
const $el = $(tooltipFormatter(event));
const $rows = $el.find('tr');
expect($rows.size()).to.be(3);
expect($rows.length).to.be(3);

const $row1 = $rows.eq(0).find('td');
expect(cell($row1, 0)).to.be('inner');
Expand Down
8 changes: 4 additions & 4 deletions src/ui/public/agg_table/__tests__/_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('AggTableGroup Directive', function () {
$scope.$digest();

// should create one sub-tbale
expect($el.find('kbn-agg-table').size()).to.be(1);
expect($el.find('kbn-agg-table').length).to.be(1);
});

it('renders nothing if the table list is empty', function () {
Expand All @@ -63,7 +63,7 @@ describe('AggTableGroup Directive', function () {
$scope.$digest();

const $subTables = $el.find('kbn-agg-table');
expect($subTables.size()).to.be(0);
expect($subTables.length).to.be(0);
});

it('renders a complex response properly', function () {
Expand All @@ -86,10 +86,10 @@ describe('AggTableGroup Directive', function () {
$scope.$digest();

const $subTables = $el.find('kbn-agg-table');
expect($subTables.size()).to.be(3);
expect($subTables.length).to.be(3);

const $subTableHeaders = $el.find('.agg-table-group-header');
expect($subTableHeaders.size()).to.be(3);
expect($subTableHeaders.length).to.be(3);

$subTableHeaders.each(function (i) {
expect($(this).text()).to.be(group.tables[i].title);
Expand Down
18 changes: 9 additions & 9 deletions src/ui/public/agg_table/__tests__/_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ describe('AggTable Directive', function () {
const $el = $compile('<kbn-agg-table table="table"></kbn-agg-table>')($scope);
$scope.$digest();

expect($el.find('tbody').size()).to.be(1);
expect($el.find('td').size()).to.be(1);
expect($el.find('tbody').length).to.be(1);
expect($el.find('td').length).to.be(1);
expect($el.find('td').text()).to.eql(1000);
});

Expand All @@ -57,7 +57,7 @@ describe('AggTable Directive', function () {
const $el = $compile('<kbn-agg-table table="table"></kbn-agg-table>')($scope);
$scope.$digest();

expect($el.find('tbody').size()).to.be(0);
expect($el.find('tbody').length).to.be(0);
});

it('renders a complex response properly', function () {
Expand All @@ -79,10 +79,10 @@ describe('AggTable Directive', function () {
$compile($el)($scope);
$scope.$digest();

expect($el.find('tbody').size()).to.be(1);
expect($el.find('tbody').length).to.be(1);

const $rows = $el.find('tbody tr');
expect($rows.size()).to.be.greaterThan(0);
expect($rows.length).to.be.greaterThan(0);

function validBytes(str) {
expect(str).to.match(/^\d+$/);
Expand All @@ -93,7 +93,7 @@ describe('AggTable Directive', function () {
$rows.each(function () {
// 6 cells in every row
const $cells = $(this).find('td');
expect($cells.size()).to.be(6);
expect($cells.length).to.be(6);

const txts = $cells.map(function () {
return $(this).text().trim();
Expand Down Expand Up @@ -147,13 +147,13 @@ describe('AggTable Directive', function () {
$compile($el)($scope);
$scope.$digest();

expect($el.find('tfoot').size()).to.be(1);
expect($el.find('tfoot').length).to.be(1);

const $rows = $el.find('tfoot tr');
expect($rows.size()).to.be(1);
expect($rows.length).to.be(1);

const $cells = $($rows[0]).find('th');
expect($cells.size()).to.be(6);
expect($cells.length).to.be(6);

for (let i = 0; i < 6; i++) {
expect($($cells[i]).text()).to.be(expected[i]);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/directives/__tests__/timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ describe('timepicker directive', function () {
$scope.$digest();

const startDate = moment('1980-01-01T00:11:02.001Z');
const endDate = moment('1983-10-11T0=40:03:32.051Z');
const endDate = moment('1983-10-11T00:03:32.051Z');

$parentScope.timefilter.time.from = startDate;
$parentScope.timefilter.time.to = endDate;
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/directives/paginate.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ uiModules.get('kibana')
link: {
pre: function ($scope, $el, attrs) {
if (_.isUndefined(attrs.bottomControls)) attrs.bottomControls = true;
if ($el.find('paginate-controls.paginate-bottom').size() === 0 && attrs.bottomControls) {
if ($el.find('paginate-controls.paginate-bottom').length === 0 && attrs.bottomControls) {
$el.append($compile('<paginate-controls class="paginate-bottom">')($scope));
}
},
post: function ($scope, $el, attrs) {
if (_.isUndefined(attrs.topControls)) attrs.topControls = false;
if ($el.find('paginate-controls.paginate-top').size() === 0 && attrs.topControls) {
if ($el.find('paginate-controls.paginate-top').length === 0 && attrs.topControls) {
$el.prepend($compile('<paginate-controls class="paginate-top">')($scope));
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/doc_table/components/table_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ module.directive('kbnTableRow', function (kibiState, $compile, $httpParamSeriali
const $target = reuse ? $(reuse).detach() : $(html);
$target.data('discover:html', html);
const $before = $cells.eq(i - 1);
if ($before.size()) {
if ($before.length) {
$before.after($target);
} else {
$el.append($target);
Expand Down
10 changes: 5 additions & 5 deletions src/ui/public/jquery/__tests__/find_test_subject.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ describe('jQuery.findTestSubject', function () {
const $otherMatch = $make('subject').appendTo($container);

const $found = $container.findTestSubject('subject');
expect($found.filter($match).size()).to.be(1);
expect($found.filter($otherMatch).size()).to.be(1);
expect($found.filter($match).length).to.be(1);
expect($found.filter($otherMatch).length).to.be(1);
});

it('finds all of the elements with either subject', function () {
Expand All @@ -33,9 +33,9 @@ describe('jQuery.findTestSubject', function () {
const $noMatch = $make('notSubject').appendTo($container);

const $found = $container.findTestSubject('subject', 'alsoSubject');
expect($found.filter($match1).size()).to.be(1);
expect($found.filter($match2).size()).to.be(1);
expect($found.filter($noMatch).size()).to.be(0);
expect($found.filter($match1).length).to.be(1);
expect($found.filter($match2).length).to.be(1);
expect($found.filter($noMatch).length).to.be(0);
});

it('finds all of the elements with a decendant selector', function () {
Expand Down
26 changes: 13 additions & 13 deletions src/ui/public/kibi/directives/__tests__/kibi_menu_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ describe('Kibi Components', function () {
it('check that container was appended to body, and destroyed', function () {
init();

expect($menu.size()).to.equal(1);
expect($menu.length).to.equal(1);
expect($menu[0].children.length).to.equal(0);
expect($menu.hasClass('visible')).to.equal(false);

// destroy
$scope.$destroy();
$menu = $document.find('body div.kibi-menu-template');
expect($menu.size()).to.equal(0);
expect($menu.length).to.equal(0);
});

describe('destroy afterEach', function () {
Expand All @@ -66,7 +66,7 @@ describe('Kibi Components', function () {

it('visible class added removed correctly', function () {
init();
expect($menu.size()).to.equal(1);
expect($menu.length).to.equal(1);

// click to show
$element.click();
Expand All @@ -79,7 +79,7 @@ describe('Kibi Components', function () {

it('click outside element should hide menu', function () {
init();
expect($menu.size()).to.equal(1);
expect($menu.length).to.equal(1);

// click to show
$element.click();
Expand All @@ -101,7 +101,7 @@ describe('Kibi Components', function () {
onHide: onHideSpy
});

expect($menu.size()).to.equal(1);
expect($menu.length).to.equal(1);

$element.click();
$element.click();
Expand All @@ -113,7 +113,7 @@ describe('Kibi Components', function () {
it('position properties set correctly', function () {
init();

expect($menu.size()).to.equal(1);
expect($menu.length).to.equal(1);

//make it visible
$element.click();
Expand All @@ -127,7 +127,7 @@ describe('Kibi Components', function () {
leftOffset: 123
});

expect($menu.size()).to.equal(1);
expect($menu.length).to.equal(1);

//make it visible
$element.click();
Expand All @@ -151,9 +151,9 @@ describe('Kibi Components', function () {
context: { name: 'foo' }
});

expect($menu.size()).to.equal(1);
expect($menu.length).to.equal(1);
expect($menu.hasClass('visible')).to.equal(false);
expect($menu.find('span').size()).to.equal(1);
expect($menu.find('span').length).to.equal(1);
expect($menu.find('span').text()).to.equal('foo');

// now lets change the name
Expand All @@ -180,9 +180,9 @@ describe('Kibi Components', function () {
]
});

expect($menu.size()).to.equal(1);
expect($menu.length).to.equal(1);
expect($menu.hasClass('visible')).to.equal(false);
expect($menu.find('span').size()).to.equal(2);
expect($menu.find('span').length).to.equal(2);
expect($menu.find('span:nth-child(1)').text()).to.equal('A');
expect($menu.find('span:nth-child(2)').text()).to.equal('B');

Expand All @@ -205,9 +205,9 @@ describe('Kibi Components', function () {
]
});

expect($menu.size()).to.equal(1);
expect($menu.length).to.equal(1);
expect($menu.hasClass('visible')).to.equal(false);
expect($menu.find('span').size()).to.equal(2);
expect($menu.find('span').length).to.equal(2);

// make it visible
$element.click();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/notify/notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ Notifier.prototype._showFatal = function (err) {

let $container = $('#fatal-splash-screen');

if (!$container.size()) {
if (!$container.length) {
$(document.body)
// in case the app has not completed boot
.removeAttr('ng-cloak')
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/number_list/number_list_input.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ uiModules
function go(dir) {
return function () {
const $to = $get(dir);
if ($to.size()) $to.focus();
if ($to.length) $to.focus();
else return false;
};
}
Expand Down
Loading

0 comments on commit afc5cb0

Please sign in to comment.