@reactful/create 1.2.23 → 1.2.25
Sign up to get free protection for your applications and to get access to all the features.
- package/commons/package.json +4 -5
- package/package.json +2 -2
- package/templates/minimal/builds/about.html +30 -0
- package/templates/minimal/builds/bundle.js +34981 -0
- package/templates/minimal/builds/bundle.ts +20 -0
- package/templates/minimal/builds/clock.html +30 -0
- package/templates/minimal/builds/counter.html +37 -0
- package/templates/minimal/builds/forms/form.html +48 -0
- package/templates/minimal/builds/forms/index.html +48 -0
- package/templates/minimal/builds/hello.html +62 -0
- package/templates/minimal/builds/htmlx.html +27 -0
- package/templates/minimal/builds/htmlx.tsx +13 -0
- package/templates/minimal/builds/index.html +98 -11
- package/templates/minimal/builds/login.html +48 -0
- package/templates/minimal/builds/profile/index.html +55 -0
- package/templates/minimal/builds/quotes.html +27 -0
- package/templates/minimal/builds/shared.js +76 -0
- package/templates/minimal/builds/system.html +28 -0
- package/templates/minimal/components/index.ts +1 -2
- package/templates/minimal/components/label.tsx +7 -0
- package/templates/minimal/index.html +12 -11
- package/templates/minimal/index.ts +2 -2
- package/templates/minimal/routes/hello.tsx +6 -0
- package/templates/minimal/routes/index.tsx +4 -7
- package/templates/sampling/apis/auth/db.ts +14 -14
- package/templates/sampling/apis/auth/index.ts +27 -27
- package/templates/sampling/apis/hello.ts +2 -2
- package/templates/sampling/apis/quotes.ts +15 -15
- package/templates/sampling/apis/sub/index.ts +2 -2
- package/templates/sampling/apis/sub/sub.ts +2 -2
- package/templates/sampling/assets/bootstrap-icons.css +4 -4
- package/templates/sampling/assets/default.css +93 -93
- package/templates/sampling/assets/icon.svg +6 -6
- package/templates/sampling/assets/manifest.json +56 -56
- package/templates/sampling/assets/markdown.css +273 -273
- package/templates/sampling/assets/robots.txt +1 -1
- package/templates/sampling/assets/system.css +6 -6
- package/templates/sampling/builds/about.html +30 -0
- package/templates/sampling/builds/bundle.js +34981 -0
- package/templates/sampling/builds/bundle.ts +20 -0
- package/templates/sampling/builds/clock.html +30 -0
- package/templates/sampling/builds/counter.html +37 -0
- package/templates/sampling/builds/forms/form.html +48 -0
- package/templates/sampling/builds/forms/index.html +48 -0
- package/templates/sampling/builds/hello.html +62 -0
- package/templates/sampling/builds/htmlx.html +27 -0
- package/templates/sampling/builds/htmlx.tsx +13 -0
- package/templates/sampling/builds/index.html +98 -98
- package/templates/sampling/builds/login.html +48 -0
- package/templates/sampling/builds/profile/index.html +55 -0
- package/templates/sampling/builds/quotes.html +27 -0
- package/templates/sampling/builds/shared.js +76 -0
- package/templates/sampling/builds/system.html +28 -0
- package/templates/sampling/components/header.tsx +6 -6
- package/templates/sampling/components/hello.tsx +8 -8
- package/templates/sampling/components/icon.tsx +10 -10
- package/templates/sampling/components/index.ts +2 -2
- package/templates/sampling/index.html +20 -20
- package/templates/sampling/index.ts +18 -18
- package/templates/sampling/routes/about.html +12 -12
- package/templates/sampling/routes/clock.tsx +32 -36
- package/templates/sampling/routes/counter.tsx +16 -7
- package/templates/sampling/routes/forms/form.tsx +49 -50
- package/templates/sampling/routes/hello.tsx +57 -58
- package/templates/sampling/routes/htmlx.html +14 -14
- package/templates/sampling/routes/index.md +14 -14
- package/templates/sampling/routes/login.tsx +34 -35
- package/templates/sampling/routes/profile/detail.css +12 -12
- package/templates/sampling/routes/profile/detail.tsx +46 -47
- package/templates/sampling/routes/profile/index.tsx +13 -13
- package/templates/sampling/routes/profile/profile.css +8 -8
- package/templates/sampling/routes/profile/tester.tsx +10 -10
- package/templates/sampling/routes/quotes.tsx +1 -1
- package/templates/sampling/routes/system.tsx +1 -2
- package/templates/sampling/tests/access.spec.ts +29 -29
- package/templates/sampling/tests/counter.spec.ts +18 -18
- package/templates/sampling/tests/form.spec.ts +50 -50
- package/templates/sampling/tests/hello.spec.ts +24 -24
- package/templates/sampling/tests/path.test.ts +19 -19
- package/templates/minimal/components/hello.tsx +0 -9
- package/templates/minimal/components/icon.tsx +0 -11
@@ -1,51 +1,51 @@
|
|
1
|
-
// import { test, expect } from '@playwright/test'
|
2
|
-
|
3
|
-
// async function goto(page) {
|
4
|
-
// await page.goto('http://localhost:3000/forms')
|
5
|
-
// await page.waitForTimeout(1500)
|
6
|
-
// }
|
7
|
-
|
8
|
-
// test(`form validation: checkbox`, async function({ page }) {
|
9
|
-
// await goto(page)
|
10
|
-
// await page.click('button', { delay:333 })
|
11
|
-
|
12
|
-
// const check = await page.locator('[type="checkbox"]')
|
13
|
-
// const checkHandle = await check!.evaluateHandle(x => x['validationMessage'])
|
14
|
-
// const validationMessage = await checkHandle.jsonValue()
|
15
|
-
|
16
|
-
// expect(validationMessage).toBe('Please check this box if you want to proceed')
|
17
|
-
// })
|
18
|
-
|
19
|
-
// test(`form validation: input`, async function({ page }) {
|
20
|
-
// await goto(page)
|
21
|
-
// await page.click('[uid="14"]')
|
22
|
-
// await page.click('button', { delay:333 })
|
23
|
-
|
24
|
-
// const input = await page.evaluate(() => document.querySelector('[bind="mode"]'))
|
25
|
-
// const validationMessage = input && input['validationMessage']
|
26
|
-
|
27
|
-
// // const input = await page.$('[bind="mode"]');
|
28
|
-
// // const inputHandle = await input!.evaluateHandle(x => x['validationMessage'])
|
29
|
-
// // const validationMessage = await inputHandle.jsonValue()
|
30
|
-
|
31
|
-
// expect(validationMessage).toBe('Mode is required!')
|
32
|
-
// })
|
33
|
-
|
34
|
-
// test(`form action: errors feedback`, async function({ page }) {
|
35
|
-
// await goto(page)
|
36
|
-
|
37
|
-
// const checkbox = await page.getByLabel('Accepted?')
|
38
|
-
// await checkbox.click()
|
39
|
-
|
40
|
-
// await page.getByLabel('Accepted?').click()
|
41
|
-
// await page.fill('[bind="mode"]', 'ok', { timeout:99 })
|
42
|
-
// await page.click('button', { delay:333 })
|
43
|
-
|
44
|
-
// const progress = await page.locator('progress').isVisible()
|
45
|
-
// expect(progress).toBe(true)
|
46
|
-
|
47
|
-
// await page.waitForTimeout(333)
|
48
|
-
|
49
|
-
// const li = await page.locator('ul > li').innerHTML()
|
50
|
-
// expect(li).toContain('URL not found')
|
1
|
+
// import { test, expect } from '@playwright/test'
|
2
|
+
|
3
|
+
// async function goto(page) {
|
4
|
+
// await page.goto('http://localhost:3000/forms')
|
5
|
+
// await page.waitForTimeout(1500)
|
6
|
+
// }
|
7
|
+
|
8
|
+
// test(`form validation: checkbox`, async function({ page }) {
|
9
|
+
// await goto(page)
|
10
|
+
// await page.click('button', { delay:333 })
|
11
|
+
|
12
|
+
// const check = await page.locator('[type="checkbox"]')
|
13
|
+
// const checkHandle = await check!.evaluateHandle(x => x['validationMessage'])
|
14
|
+
// const validationMessage = await checkHandle.jsonValue()
|
15
|
+
|
16
|
+
// expect(validationMessage).toBe('Please check this box if you want to proceed')
|
17
|
+
// })
|
18
|
+
|
19
|
+
// test(`form validation: input`, async function({ page }) {
|
20
|
+
// await goto(page)
|
21
|
+
// await page.click('[uid="14"]')
|
22
|
+
// await page.click('button', { delay:333 })
|
23
|
+
|
24
|
+
// const input = await page.evaluate(() => document.querySelector('[bind="mode"]'))
|
25
|
+
// const validationMessage = input && input['validationMessage']
|
26
|
+
|
27
|
+
// // const input = await page.$('[bind="mode"]');
|
28
|
+
// // const inputHandle = await input!.evaluateHandle(x => x['validationMessage'])
|
29
|
+
// // const validationMessage = await inputHandle.jsonValue()
|
30
|
+
|
31
|
+
// expect(validationMessage).toBe('Mode is required!')
|
32
|
+
// })
|
33
|
+
|
34
|
+
// test(`form action: errors feedback`, async function({ page }) {
|
35
|
+
// await goto(page)
|
36
|
+
|
37
|
+
// const checkbox = await page.getByLabel('Accepted?')
|
38
|
+
// await checkbox.click()
|
39
|
+
|
40
|
+
// await page.getByLabel('Accepted?').click()
|
41
|
+
// await page.fill('[bind="mode"]', 'ok', { timeout:99 })
|
42
|
+
// await page.click('button', { delay:333 })
|
43
|
+
|
44
|
+
// const progress = await page.locator('progress').isVisible()
|
45
|
+
// expect(progress).toBe(true)
|
46
|
+
|
47
|
+
// await page.waitForTimeout(333)
|
48
|
+
|
49
|
+
// const li = await page.locator('ul > li').innerHTML()
|
50
|
+
// expect(li).toContain('URL not found')
|
51
51
|
// })
|
@@ -1,25 +1,25 @@
|
|
1
|
-
import { test, expect } from '@playwright/test'
|
2
|
-
|
3
|
-
const cases = [
|
4
|
-
['local', 'hi!', '[id="1"]', '#l1'],
|
5
|
-
['global (outer)', 'hi!', '[id="2"]', '#l2'],
|
6
|
-
['global (inner)', 'hi!', '[id="3"]', '#l2'],
|
7
|
-
]
|
8
|
-
|
9
|
-
cases.forEach(function(scenario) {
|
10
|
-
const [ scope, text, inputId, labelId ] = scenario
|
11
|
-
|
12
|
-
test(`hello: ${scope} props binding`, async function({ page }) {
|
13
|
-
await page.goto('http://localhost:3000/hello')
|
14
|
-
await page.waitForTimeout(99)
|
15
|
-
|
16
|
-
for await (const char of text.split('')) {
|
17
|
-
await page.waitForTimeout(99)
|
18
|
-
await page.type(inputId, char, { delay: 99 })
|
19
|
-
}
|
20
|
-
|
21
|
-
await page.waitForTimeout(99)
|
22
|
-
const result = await page.locator(labelId).innerText()
|
23
|
-
expect(result).toBe(text)
|
24
|
-
})
|
1
|
+
import { test, expect } from '@playwright/test'
|
2
|
+
|
3
|
+
const cases = [
|
4
|
+
['local', 'hi!', '[id="1"]', '#l1'],
|
5
|
+
['global (outer)', 'hi!', '[id="2"]', '#l2'],
|
6
|
+
['global (inner)', 'hi!', '[id="3"]', '#l2'],
|
7
|
+
]
|
8
|
+
|
9
|
+
cases.forEach(function(scenario) {
|
10
|
+
const [ scope, text, inputId, labelId ] = scenario
|
11
|
+
|
12
|
+
test(`hello: ${scope} props binding`, async function({ page }) {
|
13
|
+
await page.goto('http://localhost:3000/hello')
|
14
|
+
await page.waitForTimeout(99)
|
15
|
+
|
16
|
+
for await (const char of text.split('')) {
|
17
|
+
await page.waitForTimeout(99)
|
18
|
+
await page.type(inputId, char, { delay: 99 })
|
19
|
+
}
|
20
|
+
|
21
|
+
await page.waitForTimeout(99)
|
22
|
+
const result = await page.locator(labelId).innerText()
|
23
|
+
expect(result).toBe(text)
|
24
|
+
})
|
25
25
|
})
|
@@ -1,20 +1,20 @@
|
|
1
|
-
import { test, expect } from 'bun:test'
|
2
|
-
|
3
|
-
const scenarios = [
|
4
|
-
['url', '/routes', '/'],
|
5
|
-
['sub url', '/routes/sub', '/sub'],
|
6
|
-
['http', 'http://domain.com/routes', '/'],
|
7
|
-
['https', 'https://domain.com/routes', '/'],
|
8
|
-
['https port', 'https://domain.com:3000/routes', '/'],
|
9
|
-
['https port file', 'https://domain.com:3000/routes/file.tsx', '/file'],
|
10
|
-
['https port index', 'https://domain.com:3000/routes/index', '/'],
|
11
|
-
['https port sub file', 'https://domain.com:3000/routes/sub/file.tsx', '/sub/file'],
|
12
|
-
]
|
13
|
-
|
14
|
-
scenarios.forEach(function([ scenario, sampling, expected ]) {
|
15
|
-
test(`new Path(url).href: ${scenario}`, function() {
|
16
|
-
const resulted = new URL(sampling).pathname
|
17
|
-
expect(resulted).toBe(expected as any)
|
18
|
-
// console.log('sampling:', sampling)
|
19
|
-
})
|
1
|
+
import { test, expect } from 'bun:test'
|
2
|
+
|
3
|
+
const scenarios = [
|
4
|
+
['url', '/routes', '/'],
|
5
|
+
['sub url', '/routes/sub', '/sub'],
|
6
|
+
['http', 'http://domain.com/routes', '/'],
|
7
|
+
['https', 'https://domain.com/routes', '/'],
|
8
|
+
['https port', 'https://domain.com:3000/routes', '/'],
|
9
|
+
['https port file', 'https://domain.com:3000/routes/file.tsx', '/file'],
|
10
|
+
['https port index', 'https://domain.com:3000/routes/index', '/'],
|
11
|
+
['https port sub file', 'https://domain.com:3000/routes/sub/file.tsx', '/sub/file'],
|
12
|
+
]
|
13
|
+
|
14
|
+
scenarios.forEach(function([ scenario, sampling, expected ]) {
|
15
|
+
test(`new Path(url).href: ${scenario}`, function() {
|
16
|
+
const resulted = new URL(sampling).pathname
|
17
|
+
expect(resulted).toBe(expected as any)
|
18
|
+
// console.log('sampling:', sampling)
|
19
|
+
})
|
20
20
|
})
|