@tscircuit/fake-snippets 0.0.13 → 0.0.15
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.
- package/bun-tests/fake-snippets-api/fixtures/get-test-server.ts +7 -13
- package/bun-tests/fake-snippets-api/routes/orders/create.test.ts +0 -1
- package/bun-tests/fake-snippets-api/routes/orders/get.test.ts +2 -3
- package/bun.lock +5 -0
- package/dist/bundle.js +124 -148
- package/fake-snippets-api/lib/db/schema.ts +20 -26
- package/fake-snippets-api/lib/db/seed.ts +7 -13
- package/fake-snippets-api/routes/api/_fake/seed.ts +13 -0
- package/fake-snippets-api/routes/api/orders/create.ts +54 -20
- package/package.json +2 -1
- package/playwright-tests/profile-page.spec.ts +4 -4
- package/src/components/SnippetTypeIcon.tsx +36 -0
- package/src/components/ViewSnippetHeader.tsx +9 -0
- package/src/components/dialogs/package-visibility-settings-dialog.tsx +0 -1
- package/src/pages/my-orders.tsx +1 -1
- package/src/pages/user-profile.tsx +96 -42
- package/src/pages/view-order.tsx +8 -20
- package/bun-tests/fake-snippets-api/routes/orders/update.test.ts +0 -46
- package/fake-snippets-api/routes/api/orders/update.ts +0 -50
|
@@ -69,18 +69,11 @@ const seedDatabase = (db: DbClient) => {
|
|
|
69
69
|
})
|
|
70
70
|
const order = db.addOrder({
|
|
71
71
|
account_id: account.account_id,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
is_approved_by_orderer: false,
|
|
78
|
-
is_in_production: false,
|
|
79
|
-
is_shipped: false,
|
|
80
|
-
is_cancelled: false,
|
|
81
|
-
should_be_blank_pcb: false,
|
|
82
|
-
should_include_stencil: false,
|
|
83
|
-
jlcpcb_order_params: {},
|
|
72
|
+
is_running: false,
|
|
73
|
+
is_started: false,
|
|
74
|
+
is_finished: false,
|
|
75
|
+
error: null,
|
|
76
|
+
has_error: false,
|
|
84
77
|
circuit_json: [
|
|
85
78
|
{
|
|
86
79
|
type: "source_component",
|
|
@@ -91,7 +84,8 @@ const seedDatabase = (db: DbClient) => {
|
|
|
91
84
|
},
|
|
92
85
|
],
|
|
93
86
|
created_at: new Date().toISOString(),
|
|
94
|
-
|
|
87
|
+
started_at: null,
|
|
88
|
+
completed_at: null,
|
|
95
89
|
})
|
|
96
90
|
|
|
97
91
|
return { account, order }
|
|
@@ -14,6 +14,5 @@ test("create order", async () => {
|
|
|
14
14
|
expect(response.status).toBe(200)
|
|
15
15
|
expect(response.data.order).toBeDefined()
|
|
16
16
|
expect(response.data.order.account_id).toBe("account-1234")
|
|
17
|
-
expect(response.data.order.is_draft).toBe(true)
|
|
18
17
|
expect(response.data.order.circuit_json).toEqual(order.circuit_json)
|
|
19
18
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getTestServer } from "bun-tests/fake-snippets-api/fixtures/get-test-server"
|
|
2
2
|
import { test, expect } from "bun:test"
|
|
3
3
|
|
|
4
|
-
test("get order", async () => {
|
|
4
|
+
test.skip("get order", async () => {
|
|
5
5
|
const {
|
|
6
6
|
axios,
|
|
7
7
|
seed: { order, account },
|
|
@@ -18,10 +18,9 @@ test("get order", async () => {
|
|
|
18
18
|
expect(response.data.order).toBeDefined()
|
|
19
19
|
expect(response.data.order.order_id).toBe(orderId)
|
|
20
20
|
expect(response.data.order.account_id).toBe(account.account_id)
|
|
21
|
-
expect(response.data.order.is_draft).toBe(true)
|
|
22
21
|
})
|
|
23
22
|
|
|
24
|
-
test("get non-existent order", async () => {
|
|
23
|
+
test.skip("get non-existent order", async () => {
|
|
25
24
|
const { axios } = await getTestServer()
|
|
26
25
|
|
|
27
26
|
try {
|
package/bun.lock
CHANGED
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"file-saver": "^2.0.5",
|
|
76
76
|
"immer": "^10.1.1",
|
|
77
77
|
"input-otp": "^1.2.4",
|
|
78
|
+
"javascript-time-ago": "^2.5.11",
|
|
78
79
|
"jose": "^5.9.3",
|
|
79
80
|
"jscad-electronics": "^0.0.25",
|
|
80
81
|
"jszip": "^3.10.1",
|
|
@@ -1415,6 +1416,8 @@
|
|
|
1415
1416
|
|
|
1416
1417
|
"jackspeak": ["jackspeak@3.4.3", "", { "dependencies": { "@isaacs/cliui": "^8.0.2" }, "optionalDependencies": { "@pkgjs/parseargs": "^0.11.0" } }, "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw=="],
|
|
1417
1418
|
|
|
1419
|
+
"javascript-time-ago": ["javascript-time-ago@2.5.11", "", { "dependencies": { "relative-time-format": "^1.1.6" } }, "sha512-Zeyf5R7oM1fSMW9zsU3YgAYwE0bimEeF54Udn2ixGd8PUwu+z1Yc5t4Y8YScJDMHD6uCx6giLt3VJR5K4CMwbg=="],
|
|
1420
|
+
|
|
1418
1421
|
"jiti": ["jiti@1.21.7", "", { "bin": { "jiti": "bin/jiti.js" } }, "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A=="],
|
|
1419
1422
|
|
|
1420
1423
|
"jju": ["jju@1.4.0", "", {}, "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA=="],
|
|
@@ -1889,6 +1892,8 @@
|
|
|
1889
1892
|
|
|
1890
1893
|
"regl": ["regl@2.1.0", "", {}, "sha512-oWUce/aVoEvW5l2V0LK7O5KJMzUSKeiOwFuJehzpSFd43dO5spP9r+sSUfhKtsky4u6MCqWJaRL+abzExynfTg=="],
|
|
1891
1894
|
|
|
1895
|
+
"relative-time-format": ["relative-time-format@1.1.6", "", {}, "sha512-aCv3juQw4hT1/P/OrVltKWLlp15eW1GRcwP1XdxHrPdZE9MtgqFpegjnTjLhi2m2WI9MT/hQQtE+tjEWG1hgkQ=="],
|
|
1896
|
+
|
|
1892
1897
|
"remove-accents": ["remove-accents@0.5.0", "", {}, "sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A=="],
|
|
1893
1898
|
|
|
1894
1899
|
"rename-keys": ["rename-keys@1.2.0", "", {}, "sha512-U7XpAktpbSgHTRSNRrjKSrjYkZKuhUukfoBlXWXUExCAqhzh1TU3BDRAfJmarcl5voKS+pbKU9MvyLWKZ4UEEg=="],
|