Skip to content

Commit

Permalink
Merge pull request #32 from CMU-313/verified-tests
Browse files Browse the repository at this point in the history
UnVerify API Tests
  • Loading branch information
KesterTan authored Oct 10, 2024
2 parents bf98345 + e1705fb commit 72ab338
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Binary file modified dump.rdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
<span class="menu-icon"><i class="fa fa-fw text-secondary fa-check"></i></span> Verify Message
</a>
</li>
{{{ else }}}
{{{ end }}}
{{{ if posts.verify }}}
<li>
<a class="dropdown-item rounded-1 d-flex align-items-center gap-2" component="post/unverify" role="menuitem" href="#">
<span class="menu-icon"><i class="fa fa-fw text-secondary fa-check"></i></span> Un-Verify Message
Expand Down
8 changes: 8 additions & 0 deletions test/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ describe('Post\'s', () => {
});
});

describe('unverifying', async () => {
it('should mark post unverified', async () => {
await apiPosts.unverify({ uid: voterUid }, { pid: postData.pid, room_id: `topic_${postData.tid}` });
const isVerified = await posts.getPostField(postData.pid, 'verify');
assert.strictEqual(isVerified, 0);
});
});

describe('answering', async () => {
it('should mark post answered', async () => {
const data = await apiPosts.answer({ uid: voterUid }, { pid: postData.pid, room_id: `topic_${postData.tid}` });
Expand Down

0 comments on commit 72ab338

Please sign in to comment.