Skip to content

Commit 63313b6

Browse files
fix: ci
1 parent b3b4ed2 commit 63313b6

File tree

6 files changed

+95
-54
lines changed

6 files changed

+95
-54
lines changed

packages/notion-client/.tsimp/compiled/src_$$_notion-api_ts.js

Lines changed: 30 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/notion-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"test:unit": "ava"
2727
},
2828
"dependencies": {
29-
"ky": "^0.31.4",
29+
"ky": "^1.7.2",
3030
"notion-types": "workspace:*",
3131
"notion-utils": "workspace:*",
3232
"p-map": "^7.0.2"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import test from 'ava'
2+
3+
import { NotionAPI } from './notion-api'
4+
5+
const pageIdFixturesSuccess = [
6+
'067dd719-a912-471e-a9a3-ac10710e7fdf',
7+
'067dd719a912471ea9a3ac10710e7fdf',
8+
'https://www.notion.so/saasifysh/Embeds-5d4e290ca4604d8fb809af806a6c1749',
9+
'https://www.notion.so/saasifysh/File-Uploads-34d650c65da34f888335dbd3ddd141dc',
10+
'Color-Rainbow-54bf56611797480c951e5c1f96cb06f2',
11+
'e68c18a461904eb5a2ddc3748e76b893',
12+
'https://www.notion.so/saasifysh/Saasify-Key-Takeaways-689a8abc1afa4699905aa2f2e585e208',
13+
'https://www.notion.so/saasifysh/TransitiveBullsh-it-78fc5a4b88d74b0e824e29407e9f1ec1',
14+
'https://www.notion.so/saasifysh/About-8d0062776d0c4afca96eb1ace93a7538',
15+
'https://www.notion.so/potionsite/newest-board-a899b98b7cdc424585e5ddebbdae60cc'
16+
17+
// collections stress test
18+
// NOTE: removing because of sporadic timeouts
19+
// 'nba-3f92ae505636427c897634a15b9f2892'
20+
]
21+
22+
const pageIdFixturesFailure = [
23+
'bdecdf150d0e40cb9f3412be132335d4', // private page
24+
'foo' // invalid page id
25+
]
26+
27+
for (const pageId of pageIdFixturesSuccess) {
28+
test(`NotionAPI.getPage success ${pageId}`, async (t) => {
29+
t.timeout(60_000) // one minute timeout
30+
31+
const api = new NotionAPI()
32+
const page = await api.getPage(pageId)
33+
34+
t.truthy(page)
35+
t.truthy(page.block)
36+
})
37+
}
38+
39+
for (const pageId of pageIdFixturesFailure) {
40+
test(`NotionAPI.getPage failure ${pageId}`, async (t) => {
41+
const api = new NotionAPI()
42+
await t.throwsAsync(() => api.getPage(pageId))
43+
})
44+
}

packages/notion-client/src/notion-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,6 @@ export class NotionAPI {
609609
json: body,
610610
headers
611611
})
612-
.json()
612+
.json<T>()
613613
}
614614
}

packages/react-notion-x/src/third-party/property.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ export function PropertyImpl(props: IPropertyProps) {
429429
const renderAutoIncrementIdValue = React.useMemo(
430430
() =>
431431
function renderAutoIncrementIdValueProperty() {
432-
return <Text value={data} block={block} />
432+
return <Text value={data} block={block!} />
433433
},
434434
[block, data]
435435
)
@@ -618,6 +618,7 @@ export function PropertyImpl(props: IPropertyProps) {
618618
renderAutoIncrementIdValue
619619
)
620620
break
621+
621622
case 'text':
622623
content = components.propertyTextValue(props, renderTextValue)
623624
break

pnpm-lock.yaml

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)