"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const chai_1 = require("chai");
const server_commands_1 = require("../../../../shared/server-commands");
describe('Test video source', () => {
    let server = null;
    const fixture = 'video_short.webm';
    before(function () {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            this.timeout(30000);
            server = yield (0, server_commands_1.createSingleServer)(1);
            yield (0, server_commands_1.setAccessTokensToServers)([server]);
        });
    });
    it('Should get the source filename with legacy upload', function () {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            this.timeout(30000);
            const { uuid } = yield server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'legacy' });
            const source = yield server.videos.getSource({ id: uuid });
            (0, chai_1.expect)(source.filename).to.equal(fixture);
        });
    });
    it('Should get the source filename with resumable upload', function () {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            this.timeout(30000);
            const { uuid } = yield server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'resumable' });
            const source = yield server.videos.getSource({ id: uuid });
            (0, chai_1.expect)(source.filename).to.equal(fixture);
        });
    });
    after(function () {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            yield (0, server_commands_1.cleanupTests)([server]);
        });
    });
});
//# sourceMappingURL=video-source.js.map