This commit is contained in:
Hongbo Wu
2022-06-26 18:53:28 +08:00
parent c1855afc72
commit eb34a40f1b

View File

@ -77,6 +77,7 @@ const createArticleQuery = (
id
title
content
isArchived
}
user {
id
@ -371,6 +372,41 @@ describe('Article API', () => {
pageId = res.body.data.createArticle.createdArticle.id
})
})
context('when saving an archived article', () => {
before(async () => {
url = 'https://example.com/saving-archived-article.com'
source = 'puppeteer-parse'
document = '<p>test</p>'
title = 'new title'
await createPage(
{
content: document,
createdAt: new Date(),
hash: 'test hash',
id: '',
pageType: PageType.Article,
readingProgressAnchorIndex: 0,
readingProgressPercent: 0,
savedAt: new Date(),
slug: 'test saving an archived article slug',
state: ArticleSavingRequestStatus.Succeeded,
title,
userId: user.id,
url,
archivedAt: new Date(),
},
ctx
)
})
it('should unarchive the article', async () => {
const res = await graphqlRequest(query, authToken).expect(200)
expect(res.body.data.createArticle.createdArticle.isArchived).to.false
})
})
})
describe('GetArticle', () => {