-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[components + fullstack tests]: warning fixes (#799)
* initial test fixes * style fixes * docs update * adjustments
- Loading branch information
1 parent
4fcda0f
commit dc3d68b
Showing
23 changed files
with
134 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,8 @@ describe("Learning snippets", () => { | |
}); | ||
|
||
it("handles errors", async function () { | ||
// stub console log to avoid ErrorBoundary warning in console | ||
const consoleStub = sinon.stub(console, "error").callsFake(() => {}); | ||
if (Number.parseInt(PresentationRpcInterface.interfaceVersion.split(".")[0], 10) < 4) { | ||
// property grid started supporting error boundaries since [email protected] | ||
this.skip(); | ||
|
@@ -87,6 +89,7 @@ describe("Learning snippets", () => { | |
// re-render the component, ensure we now get an error | ||
rerender(<MyPropertyGrid imodel={imodel} elementKey={{ ...elementKey }} />); | ||
await ensureHasError(container, "Network error"); | ||
consoleStub.restore(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,8 @@ describe("TreeDataProvider", async () => { | |
}); | ||
|
||
it("creates error node when requesting root nodes with invalid paging", async () => { | ||
// stub console log to avoid expected error in console | ||
const consoleStub = sinon.stub(console, "error").callsFake(() => {}); | ||
provider.pagingSize = 5; | ||
const nodes = await provider.getNodes(undefined, { start: 1, size: 5 }); | ||
if (nodes.length === 1) { | ||
|
@@ -102,6 +104,7 @@ describe("TreeDataProvider", async () => { | |
// [email protected] returns an empty list in case of invalid page options | ||
expect(nodes).to.be.empty; | ||
} | ||
consoleStub.restore(); | ||
}); | ||
|
||
it("returns child nodes count", async () => { | ||
|
@@ -124,6 +127,8 @@ describe("TreeDataProvider", async () => { | |
}); | ||
|
||
it("returns error node when requesting child nodes with invalid paging", async () => { | ||
// stub console log to avoid expected error in console | ||
const consoleStub = sinon.stub(console, "error").callsFake(() => {}); | ||
const rootNodes = await provider.getNodes(); | ||
provider.pagingSize = 5; | ||
const nodes = await provider.getNodes(rootNodes[0], { start: 1, size: 5 }); | ||
|
@@ -135,6 +140,7 @@ describe("TreeDataProvider", async () => { | |
// [email protected] returns an empty list in case of invalid page options | ||
expect(nodes).to.be.empty; | ||
} | ||
consoleStub.restore(); | ||
}); | ||
|
||
it("requests backend only once to get first page", async () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
* See LICENSE.md in the project root for license terms and full copyright notice. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as fs from "fs"; | ||
import path from "path"; | ||
|
||
export async function getSchemaFromPackage(packageName: string, schemaFileName: string): Promise<string> { | ||
const schemaFile = path.join(import.meta.dirname, "..", "..", "node_modules", "@bentley", packageName, schemaFileName); | ||
return fs.readFileSync(schemaFile, "utf8"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.