Skip to content

Escape expressions in JS blocks in FTL pages#48369

Open
mabartos wants to merge 1 commit intokeycloak:mainfrom
mabartos:KC-48348
Open

Escape expressions in JS blocks in FTL pages#48369
mabartos wants to merge 1 commit intokeycloak:mainfrom
mabartos:KC-48348

Conversation

@mabartos
Copy link
Copy Markdown
Contributor

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.federation.ldap.LDAPGroupMapperTest#test01_ldapOnlyGroupMappings

Keycloak CI - Base IT (5)

org.opentest4j.AssertionFailedError: expected: <4> but was: <3>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
...

Report flaky test

Copy link
Copy Markdown

@keycloak-github-bot keycloak-github-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

Copy link
Copy Markdown
Contributor

@rmartinc rmartinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mabartos! For me it's OK but don't know if maybe testing this in 4 different tests is not too many. With the LoginTemplateJsEscapingTest.java is more than enough for me. There will be errors if we change the javascript in the templates. But, I'm approving it, the only problem is that we will see test failures when changing the templates that we will need to fix.

<script type="module">
import { startSessionPolling } from "${url.resourcesPath}/js/authChecker.js";
<#outputformat "JavaScript">
import { startSessionPolling } from ${(url.resourcesPath + "/js/authChecker.js")?c};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked that it can also be:

        import { startSessionPolling } from ${"${url.resourcesPath}/js/authChecker.js"?c};

But it's Ok, it was just curiosity. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escape expressions in JS blocks in FTL pages

2 participants