-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #955 from seancdavis/new-blocks
Skip toggle blocks and inline mentions
- Loading branch information
Showing
21 changed files
with
155 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"cSpell.words": [ | ||
"octokit" | ||
] | ||
} | ||
"cSpell.words": ["octokit"], | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true, | ||
"source.addMissingImports": true | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/notion-post-publisher/__mocks__/ToggleBlock.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { faker } from "@faker-js/faker"; | ||
|
||
import { NotionToggleBlock } from "../src/types/notion"; | ||
|
||
import { mockUser } from "./User.mock"; | ||
import { mockRichText } from "./RichText.mock"; | ||
|
||
export function mockToggleBlock(): NotionToggleBlock { | ||
const user = mockUser(); | ||
|
||
return { | ||
object: "block", | ||
id: faker.datatype.uuid(), | ||
created_time: "2022-04-04T19:49:00.000Z", | ||
last_edited_time: "2022-04-04T19:50:00.000Z", | ||
created_by: user, | ||
last_edited_by: user, | ||
has_children: false, | ||
archived: false, | ||
type: "toggle", | ||
toggle: { rich_text: [mockRichText()], color: "default" }, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/notion-post-publisher/__tests__/lib/blocks/ToggleBlock.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ToggleBlock } from "../../../src/lib/blocks/ToggleBlock"; | ||
import { mockToggleBlock } from "../../../__mocks__/ToggleBlock.mock"; | ||
|
||
describe("ToggleBlock", () => { | ||
it("Renders nothing", () => { | ||
const data = mockToggleBlock(); | ||
const block = new ToggleBlock(data); | ||
const result = block.render(); | ||
expect(result).toBeNull(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/notion-post-publisher/dist/lib/blocks/ToggleBlock.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ToggleBlock = void 0; | ||
class ToggleBlock { | ||
constructor(_) { } | ||
render() { | ||
return null; | ||
} | ||
} | ||
exports.ToggleBlock = ToggleBlock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.