From e91145234fdd2e621463f795713e2b0f2ac9efc1 Mon Sep 17 00:00:00 2001 From: hardiknai-techm Date: Tue, 4 May 2021 18:34:27 +0530 Subject: [PATCH] resolve e2e test error --- package.json | 2 +- src/Utils/PricingUtils.ts | 20 +++++++++++--------- test/notebooks/upload.spec.ts | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index b073d31e0..e3f58a22a 100644 --- a/package.json +++ b/package.json @@ -191,7 +191,7 @@ "pack:fast": "node --max_old_space_size=10196 ./node_modules/webpack/bin/webpack.js --mode development --progress", "copyToConsumers": "node copyToConsumers", "test": "rimraf coverage && jest", - "test:e2e": "jest -c ./jest.config.e2e.js --detectOpenHandles", + "test:e2e": "jest -c ./jest.config.playwright.js --detectOpenHandles", "watch": "npm run start", "wait-for-server": "wait-on -t 240000 -i 5000 -v https-get://0.0.0.0:1234/", "build:ase": "gulp build:ase", diff --git a/src/Utils/PricingUtils.ts b/src/Utils/PricingUtils.ts index 9c458c3b2..a3b75e2e7 100644 --- a/src/Utils/PricingUtils.ts +++ b/src/Utils/PricingUtils.ts @@ -99,8 +99,8 @@ export function computeDisplayUsageString(usageInKB: number): string { usageInGB > 0.1 ? usageInGB.toFixed(2) + " GB" : usageInMB > 0.1 - ? usageInMB.toFixed(2) + " MB" - : usageInKB.toFixed(2) + " KB"; + ? usageInMB.toFixed(2) + " MB" + : usageInKB.toFixed(2) + " KB"; return displayUsageString; } @@ -167,8 +167,9 @@ export function getAutoPilotV3SpendHtml(maxAutoPilotThroughputSet: number, isDat maxAutoPilotThroughputSet )} RU/s (10% of max RU/s) - ${maxAutoPilotThroughputSet} RU/s based on usage.

After the first ${AutoPilotUtils.getStorageBasedOnUserInput( maxAutoPilotThroughputSet - )} GB of data stored, the max RU/s will be automatically upgraded based on the new storage value. Learn more.`; + )} GB of data stored, the max RU/s will be automatically upgraded based on the new storage value. Learn more.`; } export function getEstimatedAutoscaleSpendHtml( @@ -195,7 +196,8 @@ export function getEstimatedAutoscaleSpendHtml( `Estimated monthly cost (${currency}): ` + `${currencySign}${calculateEstimateNumber(monthlyPrice / 10)} - ` + `${currencySign}${calculateEstimateNumber(monthlyPrice)} ` + - `(${regions} ${regions === 1 ? "region" : "regions"}, ${throughput / 10 + `(${regions} ${regions === 1 ? "region" : "regions"}, ${ + throughput / 10 } - ${throughput} RU/s, ${currencySign}${pricePerRu}/RU)` ); } @@ -249,11 +251,11 @@ export function getEstimatedSpendAcknowledgeString( const currencySign: string = getCurrencySign(serverId); return !isAutoscale ? `I acknowledge the estimated ${currencySign}${calculateEstimateNumber( - dailyPrice - )} daily cost for the throughput above.` + dailyPrice + )} daily cost for the throughput above.` : `I acknowledge the estimated ${currencySign}${calculateEstimateNumber( - monthlyPrice / 10 - )} - ${currencySign}${calculateEstimateNumber(monthlyPrice)} monthly cost for the throughput above.`; + monthlyPrice / 10 + )} - ${currencySign}${calculateEstimateNumber(monthlyPrice)} monthly cost for the throughput above.`; } export function getUpsellMessage( diff --git a/test/notebooks/upload.spec.ts b/test/notebooks/upload.spec.ts index a0a4f779e..36b4658bf 100644 --- a/test/notebooks/upload.spec.ts +++ b/test/notebooks/upload.spec.ts @@ -19,7 +19,7 @@ test("Notebooks", async () => { await explorer.click('[data-test="My Notebooks"] [aria-label="More"]'); await explorer.click('button[role="menuitem"]:has-text("Upload File")'); await explorer.setInputFiles("#importFileInput", path.join(__dirname, fileToUpload)); - await explorer.click('[aria-label="Submit"]'); + await explorer.click('[aria-label="Upload"]'); await explorer.click(`[data-test="${fileToUpload}"] [aria-label="More"]`); await explorer.click('button[role="menuitem"]:has-text("Delete")'); await explorer.click('button:has-text("Delete")');