Skip to content

Commit 426a7d2

Browse files
Enhance/GitHub issue pod (#1345)
* chore: renamed github pod to github issue pod * chore: added author field in note FM * chore: renamed GithubImport and Publish Pod * fix: separated milestone API * chore: create discussion on publish
1 parent c08117d commit 426a7d2

File tree

4 files changed

+288
-40
lines changed

4 files changed

+288
-40
lines changed

packages/engine-test-utils/src/__tests__/pods-core/GithubPod.spec.ts renamed to packages/engine-test-utils/src/__tests__/pods-core/GithubIssuePod.spec.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { ENGINE_HOOKS } from "../../presets";
22
import { runEngineTestV5 } from "../../engine";
3-
import { GithubImportPod, GithubPublishPod } from "@dendronhq/pods-core";
3+
import {
4+
GithubIssueImportPod,
5+
GithubIssuePublishPod,
6+
} from "@dendronhq/pods-core";
47
import { NoteProps, NoteUtils, VaultUtils } from "@dendronhq/common-all";
58
import _ from "lodash";
69

7-
describe("GithubPod import pod", () => {
10+
describe("GithubIssuePod import pod", () => {
811
let result: any;
912
let fname: string;
1013
beforeEach(() => {
@@ -21,6 +24,9 @@ describe("GithubPod import pod", () => {
2124
number: 902,
2225
state: "OPEN",
2326
id: "sddsnjdek",
27+
author: {
28+
url: "https://github.com/xyzuser",
29+
},
2430
labels: {
2531
edges: [
2632
{
@@ -41,7 +47,7 @@ describe("GithubPod import pod", () => {
4147
test("Import Issue with status: open", async () => {
4248
await runEngineTestV5(
4349
async ({ engine, vaults, wsRoot }) => {
44-
const pod = new GithubImportPod();
50+
const pod = new GithubIssueImportPod();
4551
const vaultName = VaultUtils.getName(vaults[0]);
4652

4753
pod.getDataFromGithub = jest.fn().mockReturnValue(result);
@@ -68,6 +74,7 @@ describe("GithubPod import pod", () => {
6874
wsRoot,
6975
});
7076
expect(note.custom.status).toEqual("OPEN");
77+
expect(note.custom.author).toEqual("https://github.com/xyzuser");
7178
},
7279
{
7380
expect,
@@ -79,7 +86,7 @@ describe("GithubPod import pod", () => {
7986
test("fname as id", async () => {
8087
await runEngineTestV5(
8188
async ({ engine, vaults, wsRoot }) => {
82-
const pod = new GithubImportPod();
89+
const pod = new GithubIssueImportPod();
8390
const vaultName = VaultUtils.getName(vaults[0]);
8491

8592
pod.getDataFromGithub = jest.fn().mockReturnValue(result);
@@ -117,7 +124,7 @@ describe("GithubPod import pod", () => {
117124
test("with frontmatter", async () => {
118125
await runEngineTestV5(
119126
async ({ engine, vaults, wsRoot }) => {
120-
const pod = new GithubImportPod();
127+
const pod = new GithubIssueImportPod();
121128
const vaultName = VaultUtils.getName(vaults[0]);
122129

123130
pod.getDataFromGithub = jest.fn().mockReturnValue(result);
@@ -185,7 +192,7 @@ describe("github publish pod", () => {
185192
test("basic", async () => {
186193
await runEngineTestV5(
187194
async ({ engine, vaults, wsRoot }) => {
188-
const pod = new GithubPublishPod();
195+
const pod = new GithubIssuePublishPod();
189196
const vaultName = VaultUtils.getName(vaults[0]);
190197
pod.getLabelsFromGithub = jest
191198
.fn()
@@ -214,7 +221,7 @@ describe("github publish pod", () => {
214221
test("with invalid tags", async () => {
215222
await runEngineTestV5(
216223
async ({ engine, vaults, wsRoot }) => {
217-
const pod = new GithubPublishPod();
224+
const pod = new GithubIssuePublishPod();
218225
const vaultName = VaultUtils.getName(vaults[0]);
219226
pod.getLabelsFromGithub = jest
220227
.fn()
@@ -246,7 +253,7 @@ describe("github publish pod", () => {
246253
test("create Issue", async () => {
247254
await runEngineTestV5(
248255
async ({ engine, vaults, wsRoot }) => {
249-
const pod = new GithubPublishPod();
256+
const pod = new GithubIssuePublishPod();
250257
const vaultName = VaultUtils.getName(vaults[0]);
251258
pod.getLabelsFromGithub = jest
252259
.fn()

0 commit comments

Comments
 (0)