Skip to content

Commit 2b99c19

Browse files
authored
chore(kitchensink): move to Sanity Sandbox organization (#618)
* chore(kitchensink): move to Sanity Sandbox organization
1 parent df62564 commit 2b99c19

File tree

8 files changed

+121
-93
lines changed

8 files changed

+121
-93
lines changed

apps/kitchensink-react/e2e/multi-resource.spec.ts

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ test.describe('Multi Resource Route', () => {
2323
process.env['SDK_E2E_DATASET_0'], // First dataset
2424
)
2525

26-
// Create a player document in dataset 1
26+
// Create a movie document in dataset 1
2727
const {
28-
documentIds: [playerId],
28+
documentIds: [movieId],
2929
} = await createDocuments(
3030
[
3131
{
32-
_type: 'player',
33-
name: 'Test Player Multi Resource',
34-
slackUserId: 'U1234567890',
32+
_type: 'movie',
33+
title: 'Test Movie Multi Resource',
34+
tmdb_id: 123456,
35+
release_date: '2021-01-01',
36+
hosted_poster_path: 'https://example.com/poster.jpg',
3537
},
3638
],
3739
{asDraft: false}, // Create as published document
@@ -45,16 +47,16 @@ test.describe('Multi Resource Route', () => {
4547

4648
// Wait for both document cards to be visible
4749
await expect(pageContext.getByTestId(/^author-document-/)).toBeVisible()
48-
await expect(pageContext.getByTestId(/^player-document-/)).toBeVisible()
50+
await expect(pageContext.getByTestId(/^movie-document-/)).toBeVisible()
4951

5052
// Verify author document content is displayed
5153
await expect(pageContext.getByTestId('author-name-display')).toHaveText(
5254
'Test Author Multi Resource',
5355
)
5456

55-
// Verify player document content is displayed
56-
await expect(pageContext.getByTestId('player-name-display')).toHaveText(
57-
'Test Player Multi Resource',
57+
// Verify movie document content is displayed
58+
await expect(pageContext.getByTestId('movie-name-display')).toHaveText(
59+
'Test Movie Multi Resource',
5860
)
5961

6062
// Test author projection data
@@ -67,12 +69,14 @@ test.describe('Multi Resource Route', () => {
6769
'Best Code Award',
6870
)
6971

70-
// Test player projection data
71-
await expect(pageContext.getByTestId('player-projection-name')).toContainText(
72-
'Test Player Multi Resource',
72+
// Test movie projection data
73+
await expect(pageContext.getByTestId('movie-projection-name')).toContainText(
74+
'Test Movie Multi Resource',
7375
)
74-
await expect(pageContext.getByTestId('player-projection-slack-id')).toContainText('U1234567890')
75-
await expect(pageContext.getByTestId('player-projection-has-slack')).toContainText('Yes')
76+
await expect(pageContext.getByTestId('movie-projection-release-date')).toContainText(
77+
'2021-01-01',
78+
)
79+
await expect(pageContext.getByTestId('movie-projection-has-poster')).toContainText('Yes')
7680

7781
// Test editing the author document
7882
const authorNameInput = pageContext.getByTestId('author-name-input')
@@ -87,26 +91,26 @@ test.describe('Multi Resource Route', () => {
8791
'Updated Author Name',
8892
)
8993

90-
// Test editing the player document
91-
const playerNameInput = pageContext.getByTestId('player-name-input')
92-
await playerNameInput.fill('Updated Player Name')
93-
await playerNameInput.press('Enter')
94+
// Test editing the movie document
95+
const movieNameInput = pageContext.getByTestId('movie-name-input')
96+
await movieNameInput.fill('Updated Movie Name')
97+
await movieNameInput.press('Enter')
9498

9599
// Verify the change is reflected in the display
96-
await expect(pageContext.getByTestId('player-name-display')).toHaveText('Updated Player Name')
100+
await expect(pageContext.getByTestId('movie-name-display')).toHaveText('Updated Movie Name')
97101

98102
// Verify the change is also reflected in the projection
99-
await expect(pageContext.getByTestId('player-projection-name')).toContainText(
100-
'Updated Player Name',
103+
await expect(pageContext.getByTestId('movie-projection-name')).toContainText(
104+
'Updated Movie Name',
101105
)
102106

103107
// Test that external changes are reflected (simulating real-time updates)
104108
const authorClient = getClient(process.env['SDK_E2E_DATASET_0'])
105109
await authorClient.patch(`drafts.${authorId}`).set({name: 'Externally Updated Author'}).commit()
106110

107-
// Test external change for player
108-
const playerClient = getClient(process.env['SDK_E2E_DATASET_1'])
109-
await playerClient.patch(`drafts.${playerId}`).set({name: 'Externally Updated Player'}).commit()
111+
// Test external change for movie
112+
const movieClient = getClient(process.env['SDK_E2E_DATASET_1'])
113+
await movieClient.patch(`drafts.${movieId}`).set({title: 'Externally Updated Movie'}).commit()
110114

111115
// Verify external change is reflected
112116
await expect(async () => {
@@ -118,10 +122,10 @@ test.describe('Multi Resource Route', () => {
118122

119123
// Verify external change is reflected
120124
await expect(async () => {
121-
const playerDisplay = await pageContext.getByTestId('player-name-display').textContent()
122-
const playerProjection = await pageContext.getByTestId('player-projection-name').textContent()
123-
expect(playerDisplay).toBe('Externally Updated Player')
124-
expect(playerProjection).toContain('Externally Updated Player')
125+
const movieDisplay = await pageContext.getByTestId('movie-name-display').textContent()
126+
const movieProjection = await pageContext.getByTestId('movie-projection-name').textContent()
127+
expect(movieDisplay).toBe('Externally Updated Movie')
128+
expect(movieProjection).toContain('Externally Updated Movie')
125129
}).toPass({timeout: 5000})
126130
})
127131
})

apps/kitchensink-react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"build": "pnpm tsc && vite build",
88
"clean": "rimraf dist",
99
"deploy": "sanity deploy",
10-
"dev": "vite",
10+
"dev": "sanity dev",
1111
"install": "npm run schema:extract && npm run types:generate",
1212
"lint": "eslint .",
1313
"paramour": "npx paramour --config=./src/css/css.config.js --output=./src/css/paramour.css",
1414
"preview": "vite preview",
15-
"schema:extract": "sanity schema extract --workspace ppsg7ml5-test --path schema.ppsg7ml5.test.json && sanity schema extract --workspace d45jg133-production --path schema.d45jg133.production.json",
15+
"schema:extract": "sanity schema extract --workspace ppsg7ml5-test --path schema.ppsg7ml5.test.json && sanity schema extract --workspace vo1ysemo-production --path schema.vo1ysemo.production.json",
1616
"test:e2e": "playwright test",
1717
"tsc": "tsc --noEmit",
1818
"types:generate": "./node_modules/@sanity/cli/bin/sanity typegen generate"

apps/kitchensink-react/sanity-typegen.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"schemaId": "ppsg7ml5.test"
66
},
77
{
8-
"schemaPath": "./schema.d45jg133.production.json",
9-
"schemaId": "d45jg133.production"
8+
"schemaPath": "./schema.vo1ysemo.production.json",
9+
"schemaId": "vo1ysemo.production"
1010
}
1111
],
1212
"overloadClientMethods": false

apps/kitchensink-react/sanity.cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {defineCliConfig} from 'sanity/cli'
22

33
export default defineCliConfig({
44
app: {
5-
organizationId: 'oSyH1iET5',
5+
organizationId: 'oblZgbTFj',
66
entry: './src/App.tsx',
7-
id: 'cbhuuqhkp6sevhpreoh0so8s',
7+
id: 'wkyoigmzawwnnwx458zgoh46',
88
},
99
})

apps/kitchensink-react/sanity.config.ts

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,43 @@ const bookType = defineType({
6969
],
7070
})
7171

72-
const playerType = defineType({
73-
name: 'player',
74-
title: 'Player',
72+
const movieType = defineType({
73+
name: 'movie',
74+
title: 'Movie',
7575
type: 'document',
7676
fields: [
77-
defineField({name: 'name', title: 'Name', type: 'string'}),
78-
defineField({name: 'slackUserId', title: 'Slack User ID', type: 'string'}),
77+
{
78+
name: 'title',
79+
title: 'Title',
80+
type: 'string',
81+
validation: (Rule) => Rule.required(),
82+
},
83+
{
84+
name: 'tmdb_id',
85+
title: 'TMDB ID',
86+
type: 'number',
87+
validation: (Rule) => Rule.required(),
88+
},
89+
{
90+
name: 'poster_path',
91+
title: 'Poster Image',
92+
type: 'string',
93+
},
94+
{
95+
name: 'hosted_poster_path',
96+
title: 'Hosted Poster Image',
97+
type: 'url',
98+
},
99+
{
100+
name: 'release_date',
101+
title: 'Release Date',
102+
type: 'string',
103+
},
104+
{
105+
name: 'overview',
106+
title: 'Overview',
107+
type: 'text',
108+
},
79109
],
80110
})
81111

@@ -90,12 +120,12 @@ export default defineConfig([
90120
},
91121
},
92122
{
93-
name: 'd45jg133-production',
94-
basePath: '/d45jg133-production',
95-
projectId: 'd45jg133',
123+
name: 'vo1ysemo-production',
124+
basePath: '/vo1ysemo-production',
125+
projectId: 'vo1ysemo',
96126
dataset: 'production',
97127
schema: {
98-
types: [playerType],
128+
types: [movieType],
99129
},
100130
},
101131
])

0 commit comments

Comments
 (0)