Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move About Me card from Experiments to Seed realm #1972

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions packages/matrix/tests/live-cards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,22 @@ 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"]`),
).toContainText('Hello World');
page.locator(
`[data-test-card="${realmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0"]`,
),
).toContainText('Some folks say');

// assert that instance updates are live bound
let helloWorldPath = join(
realmServer.realmPath,
'..',
'user1',
realmName,
'hello-world.json',
'HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0.json',
);
await expect(
page.locator('[data-test-realm-indexing-indicator]'),
Expand All @@ -75,13 +79,21 @@ test.describe('Live Cards', () => {
data: {
type: 'card',
attributes: {
title: 'Hello Mars',
description: 'This is a test card instance.',
fullName: 'Hello Mars',
heroUrl:
'https://boxel-images.boxel.ai/app-assets/hello-world/beach-volley-hero.jpg',
headshotUrl:
'https://boxel-images.boxel.ai/app-assets/hello-world/luke-vb-headshot.jpg',
bio: 'Luke Melia is a beach volleyball player living in downtown New York City. He is a left-side defender with a good serve and good court sense. What Luke lacks in height, he makes up in heart and craftiness.\n\nOutside of playing beach volleyball, Luke enjoys watching professional beach volleyball, primarily the AVP (the American domestic pro tour) and the FIVB (the world tour). He also enjoys surfing, skateboarding, parkour, and rock climbing.\n\nWhen Luke is not competing or challenging himself physically, he is usually writing code or creating digital products. His languages of choice are Ruby and Javascript.\n\nLuke lives in New York City with his wife and two daughters.',
quote:
"Some folks say I was born on the wrong coast, that I live a West Coast lifestyle in New York City. But I've found a way to integrate beach volleyball into my life as a New Yorker. I've been lucky enough to play plenty outside of New York, too, from Cali to Bali to Thailand and lots of spots in between. I guess you could say I'm poly-coastal!",
description: null,
thumbnailURL: null,
},
meta: {
adoptsFrom: {
module: 'https://cardstack.com/base/card-api',
name: 'CardDef',
module: '../hello-world',
name: 'HelloWorld',
},
},
},
Expand All @@ -90,7 +102,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
20 changes: 14 additions & 6 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,23 +264,29 @@ 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"]`),
).toContainText('Hello World');
page.locator(
`[data-test-card="${newRealmURL}HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0"]`,
),
).toContainText('Some folks say');

// assert that non-logged in user is prompted to login before navigating
// directly to card in private repo
await logout(page);
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
2 changes: 1 addition & 1 deletion packages/realm-server/scripts/full-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ cd "${CURRENT_DIR}"
echo "
WARNING: Any matrix server authorization tokens cached in the browser's localstorage are now invalid. Make sure to clear browser localstorage. Also make sure to execute the following in the browser after logging in as 'user' to add the experiments realm:

window['@cardstack/host'].lookup('service:matrix-service')._client.setAccountData('com.cardstack.boxel.realms', {realms: ['http://localhost:4201/experiments/']})
window['@cardstack/host'].lookup('service:matrix-service')._client.setAccountData('app.boxel.realms', {realms: ['http://localhost:4201/experiments/']})
"
9 changes: 7 additions & 2 deletions packages/realm-server/tests/realm-server-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3079,8 +3079,13 @@ module('Realm Server', function (hooks) {
'seed file index.json exists',
);
assert.ok(
existsSync(join(realmPath, 'hello-world.json')),
'seed file hello-world.json exists',
existsSync(
join(
realmPath,
'HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0.json',
),
),
'seed file HelloWorld/47c0fc54-5099-4e9c-ad0d-8a58572d05c0.json exists',
);
assert.notOk(
existsSync(join(realmPath, 'package.json')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "card",
"attributes": {
"fullName": "Luke Melia",
"heroUrl": "https://i.imgur.com/RZ0rsfx.jpg",
"headshotUrl": "https://i.imgur.com/syzN2hU.jpg",
"heroUrl": "https://boxel-images.boxel.ai/app-assets/hello-world/beach-volley-hero.jpg",
"headshotUrl": "https://boxel-images.boxel.ai/app-assets/hello-world/luke-vb-headshot.jpg",
"bio": "Luke Melia is a beach volleyball player living in downtown New York City. He is a left-side defender with a good serve and good court sense. What Luke lacks in height, he makes up in heart and craftiness.\n\nOutside of playing beach volleyball, Luke enjoys watching professional beach volleyball, primarily the AVP (the American domestic pro tour) and the FIVB (the world tour). He also enjoys surfing, skateboarding, parkour, and rock climbing.\n\nWhen Luke is not competing or challenging himself physically, he is usually writing code or creating digital products. His languages of choice are Ruby and Javascript.\n\nLuke lives in New York City with his wife and two daughters.",
"quote": "Some folks say I was born on the wrong coast, that I live a West Coast lifestyle in New York City. But I've found a way to integrate beach volleyball into my life as a New Yorker. I've been lucky enough to play plenty outside of New York, too, from Cali to Bali to Thailand and lots of spots in between. I guess you could say I'm poly-coastal!",
"title": null,
Expand Down
15 changes: 0 additions & 15 deletions packages/seed-realm/hello-world.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/seed-realm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@cardstack/boxel-icons": "workspace:*",
"@cardstack/boxel-ui": "workspace:*",
"@cardstack/runtime-common": "workspace:*",
"@types/lodash": "^4.14.182",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

Loading