Add tests for publishedAt
This commit is contained in:
parent
20760d9160
commit
c49db162ee
2 changed files with 7 additions and 3 deletions
|
@ -22,9 +22,10 @@ const expect = chai.expect
|
||||||
|
|
||||||
describe('Test video privacy', function () {
|
describe('Test video privacy', function () {
|
||||||
let servers: ServerInfo[] = []
|
let servers: ServerInfo[] = []
|
||||||
let privateVideoId
|
let privateVideoId: number
|
||||||
let privateVideoUUID
|
let privateVideoUUID: string
|
||||||
let unlistedVideoUUID
|
let unlistedVideoUUID: string
|
||||||
|
let now: number
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(50000)
|
this.timeout(50000)
|
||||||
|
@ -133,6 +134,7 @@ describe('Test video privacy', function () {
|
||||||
privacy: VideoPrivacy.PUBLIC
|
privacy: VideoPrivacy.PUBLIC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
now = Date.now()
|
||||||
await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, attribute)
|
await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, attribute)
|
||||||
|
|
||||||
await wait(5000)
|
await wait(5000)
|
||||||
|
@ -145,6 +147,7 @@ describe('Test video privacy', function () {
|
||||||
expect(res.body.total).to.equal(1)
|
expect(res.body.total).to.equal(1)
|
||||||
expect(res.body.data).to.have.lengthOf(1)
|
expect(res.body.data).to.have.lengthOf(1)
|
||||||
expect(res.body.data[0].name).to.equal('super video public')
|
expect(res.body.data[0].name).to.equal('super video public')
|
||||||
|
expect(new Date(res.body.data[0].publishedAt).getTime()).to.be.at.least(now)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -427,6 +427,7 @@ async function completeVideoCheck (
|
||||||
expect(video.isLocal).to.equal(attributes.isLocal)
|
expect(video.isLocal).to.equal(attributes.isLocal)
|
||||||
expect(video.duration).to.equal(attributes.duration)
|
expect(video.duration).to.equal(attributes.duration)
|
||||||
expect(dateIsValid(video.createdAt)).to.be.true
|
expect(dateIsValid(video.createdAt)).to.be.true
|
||||||
|
expect(dateIsValid(video.publishedAt)).to.be.true
|
||||||
expect(dateIsValid(video.updatedAt)).to.be.true
|
expect(dateIsValid(video.updatedAt)).to.be.true
|
||||||
|
|
||||||
const res = await getVideo(url, video.uuid)
|
const res = await getVideo(url, video.uuid)
|
||||||
|
|
Loading…
Reference in a new issue