Skip to content

Commit

Permalink
Update specs checking Hello World card on seed realm
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemelia committed Dec 23, 2024
1 parent 1b09e17 commit 3963ab2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
14 changes: 10 additions & 4 deletions packages/matrix/tests/live-cards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ test.describe('Live Cards', () => {
skipOpeningAssistant: true,
});
await createRealm(page, realmName);
await page.goto(`${realmURL}hello-world`);
await page.goto(
`${realmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0`,
);
await expect(
page.locator(`[data-test-card="${realmURL}hello-world"]`),
page.locator(
`[data-test-card="${realmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0"]`,
),
).toContainText('Hello World');

// assert that instance updates are live bound
Expand All @@ -66,7 +70,7 @@ test.describe('Live Cards', () => {
'..',
'user1',
realmName,
'hello-world.json',
'HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0.json',
);
await expect(
page.locator('[data-test-realm-indexing-indicator]'),
Expand All @@ -90,7 +94,9 @@ test.describe('Live Cards', () => {
page.locator('[data-test-realm-indexing-indicator]'),
).toHaveCount(1);
await expect(
page.locator(`[data-test-card="${realmURL}hello-world"]`),
page.locator(
`[data-test-card="${realmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0"]`,
),
).toContainText('Hello Mars');
await expect(
page.locator('[data-test-realm-indexing-indicator]'),
Expand Down
18 changes: 13 additions & 5 deletions packages/matrix/tests/registration-with-token.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ test.describe('User Registration w/ Token - isolated realm server', () => {
).toHaveCount(1);
await showAllCards(page);
await expect(
page.locator(`[data-test-cards-grid-item="${newRealmURL}hello-world"]`),
page.locator(
`[data-test-cards-grid-item="${newRealmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0"]`,
),
).toHaveCount(1);
await page.locator(`[data-test-workspace-chooser-toggle]`).click();
await expect(page.locator('[data-test-workspace-chooser]')).toHaveCount(1);
Expand Down Expand Up @@ -262,9 +264,13 @@ test.describe('User Registration w/ Token - isolated realm server', () => {

// assert that logged in user can navigate directly to card in private realm without
// being asked to login
await page.goto(`${newRealmURL}hello-world`);
await page.goto(
`${newRealmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0`,
);
await expect(
page.locator(`[data-test-card="${newRealmURL}hello-world"]`),
page.locator(
`[data-test-card="${newRealmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0"]`,
),
).toContainText('Hello World');

// assert that non-logged in user is prompted to login before navigating
Expand All @@ -273,12 +279,14 @@ test.describe('User Registration w/ Token - isolated realm server', () => {
await assertLoggedOut(page);

await login(page, 'user1', 'mypassword1!', {
url: `${newRealmURL}hello-world`,
url: `${newRealmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0`,
skipOpeningAssistant: true,
});
await assertLoggedIn(page, { displayName: 'Test User' });
await expect(
page.locator(`[data-test-card="${newRealmURL}hello-world"]`),
page.locator(
`[data-test-card="${newRealmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0"]`,
),
).toHaveCount(1);

let auth = await loginUser(`user1`, 'mypassword1!');
Expand Down

0 comments on commit 3963ab2

Please sign in to comment.