fix: rm hardcoding in tests
This commit is contained in:
parent
6b2da8c83e
commit
4773c97187
2 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,11 @@ test("notifications API ", async () => {
|
||||||
test("issue API ", async () => {
|
test("issue API ", async () => {
|
||||||
let notifications = await api.getNotifications();
|
let notifications = await api.getNotifications();
|
||||||
let issue = await api.getIssue(username, repo, 1);
|
let issue = await api.getIssue(username, repo, 1);
|
||||||
|
let notification = notifications.find((n) => {
|
||||||
|
if (n.subject.html_url == issue.html_url) {
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
});
|
||||||
expect(notifications[0].subject.type).toEqual("Issue");
|
expect(notifications[0].subject.type).toEqual("Issue");
|
||||||
expect(issue.title).toEqual(notifications[0].subject.title);
|
expect(issue.title).toEqual(notifications[0].subject.title);
|
||||||
expect(issue.lazy_comments_data).toBeUndefined();
|
expect(issue.lazy_comments_data).toBeUndefined();
|
||||||
|
|
|
@ -7,6 +7,7 @@ import Repository from "./repository";
|
||||||
type Subject = {
|
type Subject = {
|
||||||
title: string;
|
title: string;
|
||||||
url: URL;
|
url: URL;
|
||||||
|
html_url: URL;
|
||||||
latest_comment_url: string;
|
latest_comment_url: string;
|
||||||
type: string; // Issue
|
type: string; // Issue
|
||||||
state: string;
|
state: string;
|
||||||
|
|
Loading…
Reference in a new issue