@tanstack/cli 0.59.8 → 0.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,68 @@
1
+ import { expect, test } from '@playwright/test'
2
+
3
+ import { attachRuntimeGuards, createReactAppFixture } from './helpers'
4
+
5
+ test('@blocking creates a React router-only app and navigates every internal link', async ({
6
+ page,
7
+ }) => {
8
+ const fixture = await createReactAppFixture({
9
+ appName: 'react-router-only-smoke-app',
10
+ routerOnly: true,
11
+ })
12
+ const guards = attachRuntimeGuards(page, fixture.url)
13
+
14
+ try {
15
+ await page.goto(fixture.url)
16
+ await expect(
17
+ page.getByRole('heading', { name: 'Island hours, but for product teams.' }),
18
+ ).toBeVisible()
19
+
20
+ const homeLinks = await page
21
+ .locator('a[href^="/"]')
22
+ .evaluateAll((anchors) =>
23
+ Array.from(new Set(anchors.map((anchor) => anchor.getAttribute('href') || '')))
24
+ .filter(Boolean)
25
+ .sort(),
26
+ )
27
+
28
+ expect(homeLinks).toContain('/blog')
29
+
30
+ await page.locator('a[href="/blog"]').first().click()
31
+ await expect(page).toHaveURL(/\/blog\/?$/)
32
+ await expect(page.getByRole('heading', { name: 'Blog' })).toBeVisible()
33
+
34
+ const blogPostLinks = await page
35
+ .locator('a[href^="/blog/"]')
36
+ .evaluateAll((anchors) =>
37
+ Array.from(new Set(anchors.map((anchor) => anchor.getAttribute('href') || '')))
38
+ .filter(Boolean)
39
+ .sort(),
40
+ )
41
+
42
+ expect(blogPostLinks.length).toBeGreaterThan(0)
43
+
44
+ for (const postPath of blogPostLinks) {
45
+ await page.locator(`a[href="${postPath}"]`).first().click()
46
+ await expect(page).toHaveURL(new RegExp(`${postPath}/?$`))
47
+ await expect(page.locator('h1').first()).toBeVisible()
48
+ await page.goBack()
49
+ await expect(page).toHaveURL(/\/blog\/?$/)
50
+ }
51
+
52
+ await page.goto(`${fixture.url}/about`)
53
+ await expect(page.getByRole('heading', { name: 'Built for shipping fast.' })).toBeVisible()
54
+
55
+ await page.goto(fixture.url)
56
+ await expect(
57
+ page.getByRole('heading', { name: 'Island hours, but for product teams.' }),
58
+ ).toBeVisible()
59
+ } finally {
60
+ try {
61
+ guards.assertClean()
62
+ } finally {
63
+ guards.dispose()
64
+ await fixture.stop()
65
+ await fixture.cleanup()
66
+ }
67
+ }
68
+ })
@@ -0,0 +1,25 @@
1
+ import { expect, test } from '@playwright/test'
2
+
3
+ import { attachRuntimeGuards, createAppFixture } from './helpers'
4
+
5
+ test('@blocking creates a Solid app and renders the home route', async ({ page }) => {
6
+ const fixture = await createAppFixture({
7
+ appName: 'solid-smoke-app',
8
+ framework: 'solid',
9
+ })
10
+ const guards = attachRuntimeGuards(page, fixture.url)
11
+
12
+ try {
13
+ await page.goto(fixture.url)
14
+ await expect(page.getByRole('heading', { name: /TANSTACK/i })).toBeVisible()
15
+ await expect(page.getByText('The framework for next generation AI applications')).toBeVisible()
16
+ } finally {
17
+ try {
18
+ guards.assertClean()
19
+ } finally {
20
+ guards.dispose()
21
+ await fixture.stop()
22
+ await fixture.cleanup()
23
+ }
24
+ }
25
+ })
@@ -0,0 +1,52 @@
1
+ import { expect, test } from '@playwright/test'
2
+
3
+ import { attachRuntimeGuards, createReactAppFixture, getRepoPath } from './helpers'
4
+
5
+ test('@blocking creates and renders the resume template', async ({ page }) => {
6
+ const fixture = await createReactAppFixture({
7
+ appName: 'resume-template-smoke-app',
8
+ template: getRepoPath('examples/react/resume/template.json'),
9
+ })
10
+ const guards = attachRuntimeGuards(page, fixture.url)
11
+
12
+ try {
13
+ await page.goto(fixture.url)
14
+ await expect(page.getByRole('heading', { name: /Hi, I'm Jane Smith\./ })).toBeVisible()
15
+ await expect(page.getByText('Product-minded frontend engineer')).toBeVisible()
16
+
17
+ await page.getByRole('link', { name: 'Resume' }).click()
18
+ await expect(page).toHaveURL(/\/$/)
19
+ } finally {
20
+ try {
21
+ guards.assertClean()
22
+ } finally {
23
+ guards.dispose()
24
+ await fixture.stop()
25
+ await fixture.cleanup()
26
+ }
27
+ }
28
+ })
29
+
30
+ test('@blocking creates and renders the ecommerce template', async ({ page }) => {
31
+ const fixture = await createReactAppFixture({
32
+ appName: 'ecommerce-template-smoke-app',
33
+ template: getRepoPath('examples/react/ecommerce/template.json'),
34
+ })
35
+ const guards = attachRuntimeGuards(page, fixture.url)
36
+
37
+ try {
38
+ await page.goto(fixture.url)
39
+ await expect(page.getByRole('heading', { name: 'The TanStack Storefront.' })).toBeVisible()
40
+
41
+ await page.getByRole('link', { name: 'Browse Catalog' }).click()
42
+ await expect(page).toHaveURL(/\/#products$/)
43
+ } finally {
44
+ try {
45
+ guards.assertClean()
46
+ } finally {
47
+ guards.dispose()
48
+ await fixture.stop()
49
+ await fixture.cleanup()
50
+ }
51
+ }
52
+ })
package/vitest.config.js CHANGED
@@ -3,5 +3,6 @@ import { defineConfig } from 'vitest/config'
3
3
  export default defineConfig({
4
4
  test: {
5
5
  setupFiles: ['./tests/setupVitest.js'],
6
+ include: ['tests/**/*.test.ts'],
6
7
  },
7
8
  })