mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Dashboard graph optimization. Fixes #3941
This commit is contained in:
committed by
Akshay Joshi
parent
dae8186c2a
commit
aad7830d37
@@ -73,6 +73,10 @@ describe('In charting related testcases', ()=> {
|
||||
expect(chartObj.getOtherData('some_val')).toEqual(1);
|
||||
});
|
||||
|
||||
it('Check if other data returns undefined for not set', ()=>{
|
||||
expect(chartObj.getOtherData('some_val_not_set')).toBe(undefined);
|
||||
});
|
||||
|
||||
it('Check if isVisible returns correct', ()=>{
|
||||
let dimSpy = spyOn(chartObj, 'getContainerDimensions');
|
||||
|
||||
|
||||
35
web/regression/javascript/pgadmin_utils_spec.js
Normal file
35
web/regression/javascript/pgadmin_utils_spec.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////
|
||||
//
|
||||
// pgAdmin 4 - PostgreSQL Tools
|
||||
//
|
||||
// Copyright (C) 2013 - 2019, The pgAdmin Development Team
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import { getEpoch, getGCD } from 'sources/utils';
|
||||
|
||||
describe('getEpoch', function () {
|
||||
it('should return non zero', function () {
|
||||
expect(getEpoch()).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('should return epoch for a date passed', function () {
|
||||
let someDate = new Date(2019,1,1,10,20,30,40),
|
||||
someDateEpoch = 1548996630;
|
||||
|
||||
expect(getEpoch(new Date(someDate))).toEqual(someDateEpoch);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getGCD', function () {
|
||||
it('for two numbers', function () {
|
||||
let nos = [5, 10];
|
||||
expect(getGCD(nos)).toEqual(5);
|
||||
});
|
||||
|
||||
it('for more than two numbers', function () {
|
||||
let nos = [9, 24, 33];
|
||||
expect(getGCD(nos)).toEqual(3);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user