Skip to content

Commit

Permalink
Enhance/GitHub issue pod (#1345)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Harshita-mindfire committed Sep 17, 2021
1 parent c08117d commit 426a7d2
Show file tree
Hide file tree
Showing 4 changed files with 288 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { ENGINE_HOOKS } from "../../presets";
import { runEngineTestV5 } from "../../engine";
import { GithubImportPod, GithubPublishPod } from "@dendronhq/pods-core";
import {
GithubIssueImportPod,
GithubIssuePublishPod,
} from "@dendronhq/pods-core";
import { NoteProps, NoteUtils, VaultUtils } from "@dendronhq/common-all";
import _ from "lodash";

describe("GithubPod import pod", () => {
describe("GithubIssuePod import pod", () => {
let result: any;
let fname: string;
beforeEach(() => {
Expand All @@ -21,6 +24,9 @@ describe("GithubPod import pod", () => {
number: 902,
state: "OPEN",
id: "sddsnjdek",
author: {
url: "https://github.com/xyzuser",
},
labels: {
edges: [
{
Expand All @@ -41,7 +47,7 @@ describe("GithubPod import pod", () => {
test("Import Issue with status: open", async () => {
await runEngineTestV5(
async ({ engine, vaults, wsRoot }) => {
const pod = new GithubImportPod();
const pod = new GithubIssueImportPod();
const vaultName = VaultUtils.getName(vaults[0]);

pod.getDataFromGithub = jest.fn().mockReturnValue(result);
Expand All @@ -68,6 +74,7 @@ describe("GithubPod import pod", () => {
wsRoot,
});
expect(note.custom.status).toEqual("OPEN");
expect(note.custom.author).toEqual("https://github.com/xyzuser");
},
{
expect,
Expand All @@ -79,7 +86,7 @@ describe("GithubPod import pod", () => {
test("fname as id", async () => {
await runEngineTestV5(
async ({ engine, vaults, wsRoot }) => {
const pod = new GithubImportPod();
const pod = new GithubIssueImportPod();
const vaultName = VaultUtils.getName(vaults[0]);

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

pod.getDataFromGithub = jest.fn().mockReturnValue(result);
Expand Down Expand Up @@ -185,7 +192,7 @@ describe("github publish pod", () => {
test("basic", async () => {
await runEngineTestV5(
async ({ engine, vaults, wsRoot }) => {
const pod = new GithubPublishPod();
const pod = new GithubIssuePublishPod();
const vaultName = VaultUtils.getName(vaults[0]);
pod.getLabelsFromGithub = jest
.fn()
Expand Down Expand Up @@ -214,7 +221,7 @@ describe("github publish pod", () => {
test("with invalid tags", async () => {
await runEngineTestV5(
async ({ engine, vaults, wsRoot }) => {
const pod = new GithubPublishPod();
const pod = new GithubIssuePublishPod();
const vaultName = VaultUtils.getName(vaults[0]);
pod.getLabelsFromGithub = jest
.fn()
Expand Down Expand Up @@ -246,7 +253,7 @@ describe("github publish pod", () => {
test("create Issue", async () => {
await runEngineTestV5(
async ({ engine, vaults, wsRoot }) => {
const pod = new GithubPublishPod();
const pod = new GithubIssuePublishPod();
const vaultName = VaultUtils.getName(vaults[0]);
pod.getLabelsFromGithub = jest
.fn()
Expand Down
Loading

0 comments on commit 426a7d2

Please sign in to comment.