forked from matrix-org/matrix-react-sdk
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make clear notifications work with threads ([\matrix-org#9575](matrix-org#9575)). Fixes element-hq/element-web#23751. * Change "None" to "Off" in notification options ([\matrix-org#9539](matrix-org#9539)). Contributed by @Arnei. * Advanced audio processing settings ([\matrix-org#8759](matrix-org#8759)). Fixes element-hq/element-web#6278. Contributed by @MrAnno. * Add way to create a user notice via config.json ([\matrix-org#9559](matrix-org#9559)). * Improve design of the rich text editor ([\matrix-org#9533](matrix-org#9533)). Contributed by @florianduros. * Enable user to zoom beyond image size ([\matrix-org#5949](matrix-org#5949)). Contributed by @jaiwanth-v. * Fix: Move "Leave Space" option to the bottom of space context menu ([\matrix-org#9535](matrix-org#9535)). Contributed by @hanadi92. * Fix integration manager `get_open_id_token` action and add E2E tests ([\matrix-org#9520](matrix-org#9520)). * Fix links being mangled by markdown processing ([\matrix-org#9570](matrix-org#9570)). Fixes element-hq/element-web#23743. * Fix: inline links selecting radio button ([\matrix-org#9543](matrix-org#9543)). Contributed by @hanadi92. * fix wrong error message in registration when phone number threepid is in use. ([\matrix-org#9571](matrix-org#9571)). Contributed by @bagvand. * Fix missing avatar for show current profiles ([\matrix-org#9563](matrix-org#9563)). Fixes element-hq/element-web#23733. * fix read receipts trickling down correctly ([\matrix-org#9567](matrix-org#9567)). Fixes element-hq/element-web#23746. * Resilience fix for homeserver without thread notification support ([\matrix-org#9565](matrix-org#9565)). * Don't switch to the home page needlessly after leaving a room ([\matrix-org#9477](matrix-org#9477)). * Differentiate download and decryption errors when showing images ([\matrix-org#9562](matrix-org#9562)). Fixes element-hq/element-web#3892. * Close context menu when a modal is opened to prevent user getting stuck ([\matrix-org#9560](matrix-org#9560)). Fixes element-hq/element-web#15610 and element-hq/element-web#10781. * Fix TimelineReset handling when no room associated ([\matrix-org#9553](matrix-org#9553)). * Always use current profile on thread events ([\matrix-org#9524](matrix-org#9524)). Fixes element-hq/element-web#23648. * Fix `ThreadView` tests not using thread flag ([\matrix-org#9547](matrix-org#9547)). Contributed by @MadLittleMods. * Handle deletion of `m.call` events ([\matrix-org#9540](matrix-org#9540)). Fixes element-hq/element-web#23663. * Fix incorrect notification count after leaving a room with notifications ([\matrix-org#9518](matrix-org#9518)). Contributed by @Arnei.
- Loading branch information
Showing
267 changed files
with
8,364 additions
and
3,671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
143 changes: 143 additions & 0 deletions
143
cypress/e2e/integration-manager/get-openid-token.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
/* | ||
Copyright 2022 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { SynapseInstance } from "../../plugins/synapsedocker"; | ||
import { UserCredentials } from "../../support/login"; | ||
|
||
const ROOM_NAME = "Integration Manager Test"; | ||
const USER_DISPLAY_NAME = "Alice"; | ||
|
||
const INTEGRATION_MANAGER_TOKEN = "DefinitelySecret_DoNotUseThisForReal"; | ||
const INTEGRATION_MANAGER_HTML = ` | ||
<html lang="en"> | ||
<head> | ||
<title>Fake Integration Manager</title> | ||
</head> | ||
<body> | ||
<button name="Send" id="send-action">Press to send action</button> | ||
<button name="Close" id="close">Press to close</button> | ||
<p id="message-response">No response</p> | ||
<script> | ||
document.getElementById("send-action").onclick = () => { | ||
window.parent.postMessage( | ||
{ | ||
action: "get_open_id_token", | ||
}, | ||
'*', | ||
); | ||
}; | ||
document.getElementById("close").onclick = () => { | ||
window.parent.postMessage( | ||
{ | ||
action: "close_scalar", | ||
}, | ||
'*', | ||
); | ||
}; | ||
// Listen for a postmessage response | ||
window.addEventListener("message", (event) => { | ||
document.getElementById("message-response").innerText = JSON.stringify(event.data); | ||
}); | ||
</script> | ||
</body> | ||
</html> | ||
`; | ||
|
||
function openIntegrationManager() { | ||
cy.get(".mx_RightPanel_roomSummaryButton").click(); | ||
cy.get(".mx_RoomSummaryCard_appsGroup").within(() => { | ||
cy.contains("Add widgets, bridges & bots").click(); | ||
}); | ||
} | ||
|
||
function sendActionFromIntegrationManager(integrationManagerUrl: string) { | ||
cy.accessIframe(`iframe[src*="${integrationManagerUrl}"]`).within(() => { | ||
cy.get("#send-action").should("exist").click(); | ||
}); | ||
} | ||
|
||
describe("Integration Manager: Get OpenID Token", () => { | ||
let testUser: UserCredentials; | ||
let synapse: SynapseInstance; | ||
let integrationManagerUrl: string; | ||
|
||
beforeEach(() => { | ||
cy.serveHtmlFile(INTEGRATION_MANAGER_HTML).then(url => { | ||
integrationManagerUrl = url; | ||
}); | ||
cy.startSynapse("default").then(data => { | ||
synapse = data; | ||
|
||
cy.initTestUser(synapse, USER_DISPLAY_NAME, () => { | ||
cy.window().then(win => { | ||
win.localStorage.setItem("mx_scalar_token", INTEGRATION_MANAGER_TOKEN); | ||
win.localStorage.setItem(`mx_scalar_token_at_${integrationManagerUrl}`, INTEGRATION_MANAGER_TOKEN); | ||
}); | ||
}).then(user => { | ||
testUser = user; | ||
}); | ||
|
||
cy.setAccountData("m.widgets", { | ||
"m.integration_manager": { | ||
content: { | ||
type: "m.integration_manager", | ||
name: "Integration Manager", | ||
url: integrationManagerUrl, | ||
data: { | ||
api_url: integrationManagerUrl, | ||
}, | ||
}, | ||
id: "integration-manager", | ||
}, | ||
}).as("integrationManager"); | ||
|
||
// Succeed when checking the token is valid | ||
cy.intercept(`${integrationManagerUrl}/account?scalar_token=${INTEGRATION_MANAGER_TOKEN}*`, req => { | ||
req.continue(res => { | ||
return res.send(200, { | ||
user_id: testUser.userId, | ||
}); | ||
}); | ||
}); | ||
|
||
cy.createRoom({ | ||
name: ROOM_NAME, | ||
}).as("roomId"); | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.stopSynapse(synapse); | ||
cy.stopWebServers(); | ||
}); | ||
|
||
it("should successfully obtain an openID token", () => { | ||
cy.all([ | ||
cy.get<{}>("@integrationManager"), | ||
]).then(() => { | ||
cy.viewRoomByName(ROOM_NAME); | ||
|
||
openIntegrationManager(); | ||
sendActionFromIntegrationManager(integrationManagerUrl); | ||
|
||
cy.accessIframe(`iframe[src*="${integrationManagerUrl}"]`).within(() => { | ||
cy.get("#message-response").should('include.text', 'access_token'); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.