From 7fed637506043e4432cbebe041ada0625171cceb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 22 Apr 2020 16:07:04 +0200 Subject: Begin auth plugin support --- server/tests/plugins/id-and-pass-auth.ts | 69 ++++++++++++++++++++++++++++++++ server/tests/plugins/index.ts | 1 + 2 files changed, 70 insertions(+) create mode 100644 server/tests/plugins/id-and-pass-auth.ts (limited to 'server/tests/plugins') diff --git a/server/tests/plugins/id-and-pass-auth.ts b/server/tests/plugins/id-and-pass-auth.ts new file mode 100644 index 000000000..5b4d1a1db --- /dev/null +++ b/server/tests/plugins/id-and-pass-auth.ts @@ -0,0 +1,69 @@ +/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ + +import 'mocha' +import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../shared/extra-utils/server/servers' +import { getPluginTestPath, installPlugin, setAccessTokensToServers } from '../../../shared/extra-utils' + +describe('Test id and pass auth plugins', function () { + let server: ServerInfo + + before(async function () { + this.timeout(30000) + + server = await flushAndRunServer(1) + await setAccessTokensToServers([ server ]) + + await installPlugin({ + url: server.url, + accessToken: server.accessToken, + path: getPluginTestPath('-id-pass-auth-one') + }) + + await installPlugin({ + url: server.url, + accessToken: server.accessToken, + path: getPluginTestPath('-id-pass-auth-two') + }) + }) + + it('Should not login', async function() { + + }) + + it('Should login Spyro, create the user and use the token', async function() { + + }) + + it('Should login Crash, create the user and use the token', async function() { + + }) + + it('Should login the first Laguna, create the user and use the token', async function() { + + }) + + it('Should update Crash profile', async function () { + + }) + + it('Should logout Crash', async function () { + + // test token + }) + + it('Should have logged the Crash logout', async function () { + + }) + + it('Should login Crash and keep the old existing profile', async function () { + + }) + + it('Should uninstall the plugin one and do not login existing Crash', async function () { + + }) + + after(async function () { + await cleanupTests([ server ]) + }) +}) diff --git a/server/tests/plugins/index.ts b/server/tests/plugins/index.ts index 1414e7e58..8aa30654a 100644 --- a/server/tests/plugins/index.ts +++ b/server/tests/plugins/index.ts @@ -1,4 +1,5 @@ import './action-hooks' +import './id-and-pass-auth' import './filter-hooks' import './translations' import './video-constants' -- cgit v1.2.3