Skip to content

Node.js based forum software built for the modern web

test: fix flag test

Barış Soner Uşaklıa0a9f2b29838
diff --git a/test/flags.js b/test/flags.js
index 84c9cd6919..e7000cb417 100644
--- a/test/flags.js
+++ b/test/flags.js
@@ -930,9 +930,9 @@ describe('Flags', () => {
assert.strictEqual(flagData.reports[0].value, '"<script>alert('ok');</script>');
});
- it('should escape filters', async () => {
+ it('should return undefined for invalid filters', async () => {
const { body } = await request.get(`${nconf.get('url')}/api/flags?quick="<script>alert('foo');</script>`, { jar });
- assert.strictEqual(body.filters.quick, '&quot;&lt;script&gt;alert(&#x27;foo&#x27;);&lt;&#x2F;script&gt;');
+ assert.strictEqual(body.filters.quick, undefined);
});
it('should not allow flagging post in private category', async () => {