From 396db30fbf8cbd02028ebe595e5669eb3d87c7ee Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 1 Nov 2019 14:10:16 +0000 Subject: [PATCH] Update tests --- spec/unit/autodiscovery.spec.js | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/spec/unit/autodiscovery.spec.js b/spec/unit/autodiscovery.spec.js index 6d4e5a3e9..77f0248fb 100644 --- a/spec/unit/autodiscovery.spec.js +++ b/spec/unit/autodiscovery.spec.js @@ -416,8 +416,8 @@ describe("AutoDiscovery", function() { ]); }); - it("should return FAIL_ERROR when the identity server configuration is wrong " + - "(missing base_url)", function() { + it("should return SUCCESS / FAIL_PROMPT when the identity server configuration " + + "is wrong (missing base_url)", function() { httpBackend.when("GET", "/_matrix/client/versions").check((req) => { expect(req.opts.uri) .toEqual("https://chat.example.org/_matrix/client/versions"); @@ -438,14 +438,14 @@ describe("AutoDiscovery", function() { AutoDiscovery.findClientConfig("example.org").then((conf) => { const expected = { "m.homeserver": { - state: "FAIL_ERROR", - error: AutoDiscovery.ERROR_INVALID_IS, + state: "SUCCESS", + error: null, // We still expect the base_url to be here for debugging purposes. base_url: "https://chat.example.org", }, "m.identity_server": { - state: "FAIL_ERROR", + state: "FAIL_PROMPT", error: AutoDiscovery.ERROR_INVALID_IS_BASE_URL, base_url: null, }, @@ -456,8 +456,8 @@ describe("AutoDiscovery", function() { ]); }); - it("should return FAIL_ERROR when the identity server configuration is wrong " + - "(empty base_url)", function() { + it("should return SUCCESS / FAIL_PROMPT when the identity server configuration " + + "is wrong (empty base_url)", function() { httpBackend.when("GET", "/_matrix/client/versions").check((req) => { expect(req.opts.uri) .toEqual("https://chat.example.org/_matrix/client/versions"); @@ -478,14 +478,14 @@ describe("AutoDiscovery", function() { AutoDiscovery.findClientConfig("example.org").then((conf) => { const expected = { "m.homeserver": { - state: "FAIL_ERROR", - error: AutoDiscovery.ERROR_INVALID_IS, + state: "SUCCESS", + error: null, // We still expect the base_url to be here for debugging purposes. base_url: "https://chat.example.org", }, "m.identity_server": { - state: "FAIL_ERROR", + state: "FAIL_PROMPT", error: AutoDiscovery.ERROR_INVALID_IS_BASE_URL, base_url: null, }, @@ -496,8 +496,8 @@ describe("AutoDiscovery", function() { ]); }); - it("should return FAIL_ERROR when the identity server configuration is wrong " + - "(validation error: 404)", function() { + it("should return SUCCESS / FAIL_PROMPT when the identity server configuration " + + "is wrong (validation error: 404)", function() { httpBackend.when("GET", "/_matrix/client/versions").check((req) => { expect(req.opts.uri) .toEqual("https://chat.example.org/_matrix/client/versions"); @@ -519,14 +519,14 @@ describe("AutoDiscovery", function() { AutoDiscovery.findClientConfig("example.org").then((conf) => { const expected = { "m.homeserver": { - state: "FAIL_ERROR", - error: AutoDiscovery.ERROR_INVALID_IS, + state: "SUCCESS", + error: null, // We still expect the base_url to be here for debugging purposes. base_url: "https://chat.example.org", }, "m.identity_server": { - state: "FAIL_ERROR", + state: "FAIL_PROMPT", error: AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, base_url: "https://identity.example.org", }, @@ -537,8 +537,8 @@ describe("AutoDiscovery", function() { ]); }); - it("should return FAIL_ERROR when the identity server configuration is wrong " + - "(validation error: 500)", function() { + it("should return SUCCESS / FAIL_PROMPT when the identity server configuration " + + "is wrong (validation error: 500)", function() { httpBackend.when("GET", "/_matrix/client/versions").check((req) => { expect(req.opts.uri) .toEqual("https://chat.example.org/_matrix/client/versions"); @@ -560,14 +560,14 @@ describe("AutoDiscovery", function() { AutoDiscovery.findClientConfig("example.org").then((conf) => { const expected = { "m.homeserver": { - state: "FAIL_ERROR", - error: AutoDiscovery.ERROR_INVALID_IS, + state: "SUCCESS", + error: null, // We still expect the base_url to be here for debugging purposes base_url: "https://chat.example.org", }, "m.identity_server": { - state: "FAIL_ERROR", + state: "FAIL_PROMPT", error: AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, base_url: "https://identity.example.org", },