mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 13:53:19 -07:00
Fixed the v1 API, added tests around that API to ensure we keep backwards compatability
This commit is contained in:
parent
580a34f28a
commit
c464b23bdc
11 changed files with 1316 additions and 137 deletions
1147
tests/cypress/fixtures/api/v1/tv-search-extra-info.json
Normal file
1147
tests/cypress/fixtures/api/v1/tv-search-extra-info.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -17,6 +17,7 @@
|
|||
import './commands'
|
||||
import './request.commands';
|
||||
import "cypress-real-events/support";
|
||||
import '@bahmutov/cy-api/support';
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
|
|
31
tests/cypress/tests/api/v1/tv-search.api.spec.ts
Normal file
31
tests/cypress/tests/api/v1/tv-search.api.spec.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { movieDetailsPage as Page } from "@/integration/page-objects";
|
||||
|
||||
describe("TV Search V1 API tests", () => {
|
||||
beforeEach(() => {
|
||||
cy.login();
|
||||
});
|
||||
|
||||
it("Get Extra TV Info", () => {
|
||||
cy.api({url: '/api/v1/search/tv/info/121361', headers: { 'Authorization': 'Bearer ' + window.localStorage.getItem('id_token')} })
|
||||
.then((res) => {
|
||||
expect(res.status).equal(200);
|
||||
cy.fixture('api/v1/tv-search-extra-info').then(x => {
|
||||
expect(res.body).deep.equal(x);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
it("Popular TV", () => {
|
||||
cy.api({url: '/api/v1/search/tv/popular', headers: { 'Authorization': 'Bearer ' + window.localStorage.getItem('id_token')} })
|
||||
.then((res) => {
|
||||
expect(res.status).equal(200);
|
||||
const body = res.body;
|
||||
expect(body.length).is.greaterThan(0);
|
||||
expect(body[0].title).is.not.null;
|
||||
expect(body[0].id).is.not.null;
|
||||
expect(body[0].id).to.be.an('number');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue