Files
plex-api-oauth/node_modules/plex-oauth/build/test/index.spec.js
luke-hagar-sp b2c7832873 Node_modules
2022-07-22 20:22:32 -05:00

29 lines
1.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var src_1 = require("../src");
describe("Module", function () {
var plexOauth = new src_1.PlexOauth({
clientIdentifier: "dhjoasoidjapoiwdmamlw",
device: "TEST DEVICE",
product: "TEST DEVICE",
version: "1",
forwardUrl: "https://localhost/"
});
it("loads and initializes", function () {
expect(plexOauth).toBeDefined();
});
it("returns a hosted ui link and poll for an auth token", function () {
plexOauth.requestHostedLoginURL().then(function (response) {
var hostedUiLink = response[0], pinId = response[1];
expect(hostedUiLink).toBeDefined();
expect(hostedUiLink).toContain("https://app.plex.tv/auth");
expect(hostedUiLink).not.toContain("undefined");
expect(hostedUiLink).not.toContain("null");
plexOauth.checkForAuthToken(pinId, 1000, 1).then(function (pinResponse) {
var authToken = pinResponse;
expect(authToken).toBeNull();
});
});
});
});
//# sourceMappingURL=index.spec.js.map