fix: rm hardcoding in tests

This commit is contained in:
Aravinth Manivannan 2023-09-19 00:01:50 +05:30
parent 6b2da8c83e
commit 4773c97187
Signed by: realaravinth
GPG key ID: F8F50389936984FF
2 changed files with 6 additions and 0 deletions

View file

@ -39,6 +39,11 @@ test("notifications API ", async () => {
test("issue API ", async () => {
let notifications = await api.getNotifications();
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(issue.title).toEqual(notifications[0].subject.title);
expect(issue.lazy_comments_data).toBeUndefined();

View file

@ -7,6 +7,7 @@ import Repository from "./repository";
type Subject = {
title: string;
url: URL;
html_url: URL;
latest_comment_url: string;
type: string; // Issue
state: string;