Skip to content

Commit

Permalink
test: fix relative path in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jan 7, 2025
1 parent 225c91e commit 127e0e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/template-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,18 +318,18 @@ describe('helpers', () => {
const iso = new Date().toISOString();
let post = { pid: 2, toPid: 1, timestamp: now, timestampISO: iso, parent: { displayname: 'baris' } };
let str = helpers.generateWroteReplied(post, 1);
assert.strictEqual(str, `[[topic:replied-to-user-ago, 1, /post/1, baris, /post/2, ${iso}]]`);
assert.strictEqual(str, `[[topic:replied-to-user-ago, 1, ${nconf.get('relative_path')}/post/1, baris, ${nconf.get('relative_path')}/post/2, ${iso}]]`);

post = { pid: 2, toPid: 1, timestamp: now, timestampISO: iso, parent: { displayname: 'baris' } };
str = helpers.generateWroteReplied(post, -1);
assert.strictEqual(str, `[[topic:replied-to-user-on, 1, /post/1, baris, /post/2, ${iso}]]`);
assert.strictEqual(str, `[[topic:replied-to-user-on, 1, ${nconf.get('relative_path')}/post/1, baris, ${nconf.get('relative_path')}/post/2, ${iso}]]`);

post = { pid: 2, timestamp: now, timestampISO: iso, parent: { displayname: 'baris' } };
str = helpers.generateWroteReplied(post, 1);
assert.strictEqual(str, `[[topic:wrote-ago, /post/2, ${iso}]]`);
assert.strictEqual(str, `[[topic:wrote-ago, ${nconf.get('relative_path')}/post/2, ${iso}]]`);

str = helpers.generateWroteReplied(post, -1);
assert.strictEqual(str, `[[topic:wrote-on, /post/2, ${iso}]]`);
assert.strictEqual(str, `[[topic:wrote-on, ${nconf.get('relative_path')}/post/2, ${iso}]]`);

done();
});
Expand Down

0 comments on commit 127e0e2

Please sign in to comment.