-
-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import test, { expect } from "@playwright/test"; | ||
import { sealData } from "iron-session"; | ||
|
||
/** | ||
* This test checks that a legacy token can be used to sign in. | ||
*/ | ||
test("should convert guest legacy token", async ({ browser }) => { | ||
const context = await browser.newContext(); | ||
const guestLegacyToken = await sealData( | ||
{ | ||
user: { | ||
id: "user-1234", | ||
isGuest: true, | ||
}, | ||
}, | ||
{ | ||
password: process.env.SECRET_PASSWORD, | ||
}, | ||
); | ||
await context.addCookies([ | ||
{ | ||
name: "rallly-session", | ||
value: guestLegacyToken, | ||
httpOnly: true, | ||
url: process.env.NEXT_PUBLIC_BASE_URL, | ||
}, | ||
]); | ||
const page = await context.newPage(); | ||
await page.goto("/polls"); | ||
await page.getByTestId("user-dropdown").click(); | ||
await expect(page.locator("text=user-1234")).toBeVisible(); | ||
}); |
1cf242d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
app – ./
app-git-main-rallly.vercel.app
app-rallly.vercel.app
rallly-vert.vercel.app
app.rallly.co