mirror of
https://github.com/1f349/lavender.git
synced 2024-12-22 15:44:07 +00:00
Fix broken test
This commit is contained in:
parent
b4787f22aa
commit
5a9e8e7e2e
@ -356,9 +356,9 @@ func TestFlowCallback(t *testing.T) {
|
|||||||
<script>
|
<script>
|
||||||
let loginData = {
|
let loginData = {
|
||||||
target:"%s",
|
target:"%s",
|
||||||
userinfo:{"aud":"%s","sub":"test-user","test-field":"ok"},
|
|
||||||
tokens: `
|
tokens: `
|
||||||
const p2 = `,
|
const p2 = `,
|
||||||
|
userinfo:{"aud":"%s","sub":"test-user","test-field":"ok"},
|
||||||
};
|
};
|
||||||
window.addEventListener("load", function () {
|
window.addEventListener("load", function () {
|
||||||
window.opener.postMessage(loginData, loginData.target);
|
window.opener.postMessage(loginData, loginData.target);
|
||||||
@ -376,7 +376,8 @@ func TestFlowCallback(t *testing.T) {
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`
|
`
|
||||||
var p1v = fmt.Sprintf(p1, clientAppDomain, clientAppDomain)
|
var p1v = fmt.Sprintf(p1, clientAppDomain)
|
||||||
|
var p2v = fmt.Sprintf(p2, clientAppDomain)
|
||||||
|
|
||||||
a := make([]byte, len(p1v))
|
a := make([]byte, len(p1v))
|
||||||
n, err := rec.Body.Read(a)
|
n, err := rec.Body.Read(a)
|
||||||
@ -394,7 +395,7 @@ func TestFlowCallback(t *testing.T) {
|
|||||||
findByte(rec.Body, ',')
|
findByte(rec.Body, ',')
|
||||||
findByte(rec.Body, '}')
|
findByte(rec.Body, '}')
|
||||||
|
|
||||||
assert.Equal(t, p2, rec.Body.String())
|
assert.Equal(t, p2v, rec.Body.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func findByte(buf *bytes.Buffer, v byte) {
|
func findByte(buf *bytes.Buffer, v byte) {
|
||||||
|
Loading…
Reference in New Issue
Block a user