Skip to content

Commit

Permalink
test: backport stability fixes (#826)
Browse files Browse the repository at this point in the history
* test: improve test stability

* chore: update version number
  • Loading branch information
porcellus authored May 28, 2024
1 parent 3ff5d6d commit 4d43284
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.41.2] - UNRELEASED

### Test changes

- Backported some test stability fixes

## [0.41.1] - 2024-05-13

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion lib/build/genericComponentOverrideContext.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/version.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/ts/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const package_version = "0.41.1";
export const package_version = "0.41.2";
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supertokens-auth-react",
"version": "0.41.1",
"version": "0.41.2",
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
"main": "./index.js",
"engines": {
Expand Down
11 changes: 8 additions & 3 deletions test/end-to-end/multitenancy.dynamic_login_methods.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,14 @@ describe("SuperTokens Multitenancy dynamic login methods", function () {

it("should postpone render with no react-router-dom", async function () {
await page.setRequestInterception(true);
const requestHandler = (request) => {
let resolveLoginMethodsReq;
const loginMethodsReqPromise = new Promise((res) => {
resolveLoginMethodsReq = res;
});
const requestHandler = async (request) => {
if (request.url().startsWith(LOGIN_METHODS_API)) {
setTimeout(() => request.continue(), 500);
await loginMethodsReqPromise;
request.continue();
} else {
request.continue();
}
Expand All @@ -249,7 +254,7 @@ describe("SuperTokens Multitenancy dynamic login methods", function () {

const spinner = await waitForSTElement(page, "[data-supertokens~=delayedRender]");
assert.ok(spinner);
await page.waitForTimeout(2000);
resolveLoginMethodsReq();
const providers = await getProvidersLabels(page);
compareArrayContents(providers, ["Continue with Apple"]);
});
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export async function getSubmitFormButtonLabel(page) {
}

export async function getProvidersLabels(page) {
await waitForSTElement(page);
await waitForSTElement(page, "[data-supertokens~=headerTitle]");
return await page.evaluate(
({ ST_ROOT_SELECTOR }) =>
Array.from(
Expand Down

0 comments on commit 4d43284

Please sign in to comment.