Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@datagrok/api-tests

Package Overview
Dependencies
Maintainers
5
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datagrok/api-tests - npm Package Compare versions

Comparing version 1.7.9 to 1.7.10

environments/test_env.yaml

2

CHANGELOG.md
# ApiTests changelog
## 1.7.9 (2023-07-24) (WIP)
## 1.7.9 (WIP)
{
"name": "@datagrok/api-tests",
"friendlyName": "API Tests",
"version": "1.7.9",
"version": "1.7.10",
"author": {

@@ -9,2 +9,3 @@ "name": "Anna Muzychyna",

},
"servicePackage": true,
"description": "Automated tests for the [Datagrok JS API](https://datagrok.ai/js-api)",

@@ -19,3 +20,3 @@ "repository": {

"cash-dom": "^8.1.1",
"datagrok-api": "1.15.4",
"datagrok-api": "^1.15.4",
"dayjs": "latest",

@@ -29,3 +30,2 @@ "rxjs": "^6.6.7",

"@typescript-eslint/parser": "^5.26.0",
"datagrok-tools": "^4.7.2",
"eslint": "^8.16.0",

@@ -32,0 +32,0 @@ "eslint-config-google": "^0.14.0",

# ApiTests
ApiTests is a [package](https://datagrok.ai/help/develop/develop#packages) for the [Datagrok](https://datagrok.ai) platform.
ApiTests is a [package](https://datagrok.ai/help/develop/#packages) for the [Datagrok](https://datagrok.ai) platform.

@@ -5,0 +5,0 @@ To add tests for Datagrok's JS API:

@@ -28,6 +28,6 @@ import {category, expect, test} from '@datagrok-libraries/utils/src/test';

logger.log('jsApiTest0', {jsApiTest1: 'jsApiTest2'}, jsApiTestType);
expect((await grok.dapi.logTypes.list({filter: jsApiTestType}))[0].name, jsApiTestType);
expect((await grok.dapi.logTypes.list({filter: jsApiTestType}))[0]?.name, jsApiTestType);
//TODO: find log
// console.log(await grok.dapi.log.list({filter: 'jsApiTest1 = "jsApiTest2"'}));
});
}, {skipReason: 'GROK-11670'});
});

@@ -26,3 +26,3 @@ import {category, expect, test, expectExceptionAsync} from '@datagrok-libraries/utils/src/test';

await expectExceptionAsync(() => _package.files.readCsv('datasets/noFile.csv').then());
});
}, {skipReason: 'GROK-13716'});
});

@@ -29,2 +29,12 @@ import * as grok from 'datagrok-api/grok';

test('Create a calculated column with script formula', async () => {
try {
const column = await df.columns.addNewCalculated('new', 'ApiTests:FormulaScript(${x})');
expect(df.columns.contains(column.name), true);
expect(column.get(0), 11);
} finally {
df.columns.remove('new');
}
});
test('Add new column dialog', () => new Promise(async (resolve, reject) => {

@@ -31,0 +41,0 @@ if ((await grok.dapi.packages.filter('PowerPack').list()).length > 0)

@@ -30,3 +30,3 @@ // import * as ui from 'datagrok-api/ui';

const df2 = DF2.clone();
grok.data.linkTables(df1, df2, ['sex', 'race'], ['sex', 'race'], [DG.SYNC_TYPE.CURRENT_ROW_TO_ROW]);
grok.data.linkTables(df1, df2, ['subj'], ['subj'], [DG.SYNC_TYPE.CURRENT_ROW_TO_ROW]);
for (let i = 0; i < 10; i++) {

@@ -36,3 +36,3 @@ df1.currentRowIdx = i;

}
}, {skipReason: 'GROK-11670'});
});

@@ -39,0 +39,0 @@ test('row to selection', async () => {

@@ -269,3 +269,3 @@ import * as DG from 'datagrok-api/dg';

const df1 = createDf();
return df1.columns.toList();
expect(df1.columns.toList().length, 2);
});

@@ -300,2 +300,10 @@

test('row list removeWhere', async () => {
const df = createDf2();
df.rows.removeWhere((r) => {
return r.get('population') < 3;
});
expect(df.rowCount, 2);
});
test('datetime column', async () => {

@@ -302,0 +310,0 @@ const t = grok.data.testData('demog');

@@ -22,15 +22,16 @@ /* eslint-disable max-len */

const testData = DG.DataFrame.fromCsv(`countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string
Belgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,1,1,1QBS,1,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,100,abc
Burundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,2,2,1ZP8,2,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,,
Cameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,3,3,2BDJ,3,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,,
Canada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,4,4,1IAN,4,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,,
Colombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,5,5,4UJ1,5,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,,
Costa Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,6,6,2BPW,6,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,,
Cuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,7,7,1QBS,7,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,,
Italy,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,8,8,1ZP8,8,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,,
Rwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,9,2BDJ,9,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,,
Switzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,10,1IAN,10,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,text,,
,,,,,,,,,,,,,,,,,,,,,`);
const testData = DG.DataFrame.fromCsv(`countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,Questions,empty_number,empty_string
Belgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,1,1,1QBS,1,1.23,<chart></chart>,text,100,abc
Burundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,2,2,1ZP8,2,1.23,<chart></chart>,text,,
Cameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,3,3,2BDJ,3,1.23,<chart></chart>,text,,
Canada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,4,4,1IAN,4,1.23,<chart></chart>,text,,
Colombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,5,5,4UJ1,5,1.23,<chart></chart>,text,,
Costa Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,6,6,2BPW,6,1.23,<chart></chart>,text,,
Cuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,7,7,1QBS,7,1.23,<chart></chart>,text,,
Italy,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,8,8,1ZP8,8,1.23,<chart></chart>,text,,
Rwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,9,2BDJ,9,1.23,<chart></chart>,text,,
Switzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,10,1IAN,10,1.23,<chart></chart>,text,,
,,,,,,,,,,,,,,,,,,,,`);
testData.columns.add(DG.Column.fromList(DG.TYPE.BYTE_ARRAY, 'BinaryImage', Array.from(new Uint8Array(11))));
const skip = ['detectMolecules', 'detectFit'];

@@ -40,3 +41,3 @@ category('Detector: All Detectors', () => {

for (const detector of detectors) {
if (detector.friendlyName === 'detectMolecules') continue;
if (skip.includes(detector.friendlyName)) continue;
test(detector.friendlyName, async () => {

@@ -43,0 +44,0 @@ const arr = [];

@@ -17,2 +17,3 @@ import * as DG from 'datagrok-api/dg';

import './functions/text-functions';
// import './functions/cache';

@@ -19,0 +20,0 @@ import './shell/shell';

@@ -20,3 +20,4 @@ import {before, category, expect, test} from '@datagrok-libraries/utils/src/test';

expect(gss.webpackDevUrl, null, 'webpackDevUrl');
expect(gss.cvmUrl.startsWith('https://cvm'), true, 'cvmUrl');
expect(gss.cvmUrl.startsWith('http://localhost') ||
gss.cvmUrl.startsWith('https://cvm') || gss.cvmUrl.startsWith('http://cvm'), true, 'cvmUrl');
expect(gss.cvmSplit, true, 'cvmSplit');

@@ -23,0 +24,0 @@ expect(gss.apiUrl.endsWith('/api'), true, 'apiUrl');

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc