test: disable post queue when testing posting logic

This commit is contained in:
Julian Lam
2025-09-05 14:39:23 -04:00
parent 15f9fbaa5c
commit 9bfce68b5e

View File

@@ -54,6 +54,14 @@ describe('Topic\'s', () => {
}); });
describe('.post', () => { describe('.post', () => {
before(() => {
meta.config.postQueue = 0;
});
after(() => {
meta.config.postQueue = 1;
});
it('should fail to create topic with invalid data', async () => { it('should fail to create topic with invalid data', async () => {
try { try {
await apiTopics.create({ uid: 0 }, null); await apiTopics.create({ uid: 0 }, null);
@@ -2337,6 +2345,12 @@ describe('Topic\'s', () => {
content: 'The content of scheduled test topic', content: 'The content of scheduled test topic',
timestamp: new Date(Date.now() + 86400000).getTime(), timestamp: new Date(Date.now() + 86400000).getTime(),
}; };
meta.config.postQueue = 0;
});
after(() => {
meta.config.postQueue = 1;
}); });
it('should create a scheduled topic as pinned, deleted, included in "topics:scheduled" zset and with a timestamp in future', async () => { it('should create a scheduled topic as pinned, deleted, included in "topics:scheduled" zset and with a timestamp in future', async () => {