diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-31 09:35:48 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-31 09:35:48 +0200 |
commit | 3229fcf704522f1499307a3f099e134ef6792dac (patch) | |
tree | 23278d1ea99122f49c401477c291e1d6a0bc9531 | |
parent | 5e1ced7067893d6601ef7f035d35f7870ab1e91d (diff) | |
download | PeerTube-3229fcf704522f1499307a3f099e134ef6792dac.tar.gz PeerTube-3229fcf704522f1499307a3f099e134ef6792dac.tar.zst PeerTube-3229fcf704522f1499307a3f099e134ef6792dac.zip |
More robust logs tests
-rw-r--r-- | server/tests/api/server/logs.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/server/tests/api/server/logs.ts b/server/tests/api/server/logs.ts index e2079f290..9cf04c501 100644 --- a/server/tests/api/server/logs.ts +++ b/server/tests/api/server/logs.ts | |||
@@ -41,8 +41,8 @@ describe('Test logs', function () { | |||
41 | const body = await logsCommand.getLogs({ startDate: now }) | 41 | const body = await logsCommand.getLogs({ startDate: now }) |
42 | const logsString = JSON.stringify(body) | 42 | const logsString = JSON.stringify(body) |
43 | 43 | ||
44 | expect(logsString.includes('video 1')).to.be.false | 44 | expect(logsString.includes('Video with name video 1')).to.be.false |
45 | expect(logsString.includes('video 2')).to.be.true | 45 | expect(logsString.includes('Video with name video 2')).to.be.true |
46 | }) | 46 | }) |
47 | 47 | ||
48 | it('Should get logs with an end date', async function () { | 48 | it('Should get logs with an end date', async function () { |
@@ -64,9 +64,9 @@ describe('Test logs', function () { | |||
64 | const body = await logsCommand.getLogs({ startDate: now1, endDate: now2 }) | 64 | const body = await logsCommand.getLogs({ startDate: now1, endDate: now2 }) |
65 | const logsString = JSON.stringify(body) | 65 | const logsString = JSON.stringify(body) |
66 | 66 | ||
67 | expect(logsString.includes('video 3')).to.be.false | 67 | expect(logsString.includes('Video with name video 3')).to.be.false |
68 | expect(logsString.includes('video 4')).to.be.true | 68 | expect(logsString.includes('Video with name video 4')).to.be.true |
69 | expect(logsString.includes('video 5')).to.be.false | 69 | expect(logsString.includes('Video with name video 5')).to.be.false |
70 | }) | 70 | }) |
71 | 71 | ||
72 | it('Should filter by level', async function () { | 72 | it('Should filter by level', async function () { |
@@ -81,14 +81,14 @@ describe('Test logs', function () { | |||
81 | const body = await logsCommand.getLogs({ startDate: now, level: 'info' }) | 81 | const body = await logsCommand.getLogs({ startDate: now, level: 'info' }) |
82 | const logsString = JSON.stringify(body) | 82 | const logsString = JSON.stringify(body) |
83 | 83 | ||
84 | expect(logsString.includes('video 6')).to.be.true | 84 | expect(logsString.includes('Video with name video 6')).to.be.true |
85 | } | 85 | } |
86 | 86 | ||
87 | { | 87 | { |
88 | const body = await logsCommand.getLogs({ startDate: now, level: 'warn' }) | 88 | const body = await logsCommand.getLogs({ startDate: now, level: 'warn' }) |
89 | const logsString = JSON.stringify(body) | 89 | const logsString = JSON.stringify(body) |
90 | 90 | ||
91 | expect(logsString.includes('video 6')).to.be.false | 91 | expect(logsString.includes('Video with name video 6')).to.be.false |
92 | } | 92 | } |
93 | }) | 93 | }) |
94 | 94 | ||