Skip to content

Commit 059e6ca

Browse files
committed
Let rememberChoicePerIdp render the mock WAYF checkbox on its own
# Why is this change needed? Prior to this change, the mock WAYF page only showed the remember my choice checkbox in per-SP mode when both rememberChoiceFeature and rememberChoicePerIdp were passed. In production only one mode can be enabled, so the per-SP mode never has the global flag set. The parameter was also missing from the testing docs. # How does it address the issue? This change makes rememberChoicePerIdp imply the feature, like in production, and documents both modes and example links in docs/testing.md and docs/js_testing.md.
1 parent 2c86aae commit 059e6ca

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎docs/js_testing.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ parameters can be used to manipulate the behaviour of the wayf that is rendered.
4242
| **Query parameter** | **Default value** | **Explanation** |
4343
|---|----|----|
4444
| displayUnconnectedIdpsWayf | (bool) false | Type: boolean. Display unconnected IdPs on the WAYF. |
45-
| rememberChoiceFeature | (bool) false | Type: boolean. Display the remember choice feature. |
45+
| rememberChoiceFeature | (bool) false | Type: boolean. Display the remember choice feature in global mode. |
46+
| rememberChoicePerIdp | (bool) false | Type: boolean. Display the remember choice feature in per-SP mode. Implies rememberChoiceFeature. |
4647
| cutoffPointForShowingUnfilteredIdps | (int) 100 | Type: integer. The number of IdPs to display on the WAYF before cutting them off. |
4748
| showIdpBanner | (bool) true | Type: boolean. Show the EduId (default IdP) banner on the WAYF or not |
4849
| defaultIdpEntityId | (string) null | Type: string. The entityId of the default IdP (EduId) |

‎docs/testing.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ The functional-testing route renders the WAYF page with synthetic IdP data, cont
2020
| `showIdPBanner` | bool | `true` | Whether to show the default IdP banner |
2121
| `displayUnconnectedIdpsWayf` | bool | `false` | Show unconnected IdPs with a "Request access" button |
2222
| `backLink` | bool | `false` | Show "Return to service provider" back link |
23-
| `rememberChoiceFeature` | bool | `false` | Show "Remember my choice" checkbox |
23+
| `rememberChoiceFeature` | bool | `false` | Show "Remember my choice" checkbox (global mode: the choice is stored in the `rememberchoice` cookie) |
24+
| `rememberChoicePerIdp` | bool | `false` | Show "Remember my choice" checkbox in per-SP mode (the choice is stored in the `rememberedidps` cookie). Implies `rememberChoiceFeature`, like in production where only one of the two modes can be enabled |
2425
| `cutoffPointForShowingUnfilteredIdps` | int | `100` | Hide the IdP list until the user searches when list length exceeds this value |
2526

2627
#### Baseline
@@ -38,7 +39,8 @@ The functional-testing route renders the WAYF page with synthetic IdP data, cont
3839

3940
#### UI features
4041
- [Back link](https://engine.dev.openconext.local/functional-testing/wayf?backLink=true)
41-
- [Remember my choice](https://engine.dev.openconext.local/functional-testing/wayf?rememberChoiceFeature=true)
42+
- [Remember my choice (global mode)](https://engine.dev.openconext.local/functional-testing/wayf?rememberChoiceFeature=true)
43+
- [Remember my choice (per-SP mode)](https://engine.dev.openconext.local/functional-testing/wayf?rememberChoicePerIdp=true)
4244
- [Default IdP banner](https://engine.dev.openconext.local/functional-testing/wayf?defaultIdpEntityId=https%3A%2F%2Fexample.com%2FentityId%2F3&showIdPBanner=true&addDiscoveries=false)
4345

4446
#### Preferred IdPs

‎src/OpenConext/EngineBlockFunctionalTestingBundle/Controllers/WayfController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function wayfAction(Request $request)
6767
shouldDisplayBanner: $showIdPBanner,
6868
backLink: $backLink,
6969
cutoffPoint: $cutoffPointForShowingUnfilteredIdps,
70-
rememberChoice: $rememberChoiceFeature,
70+
rememberChoice: $rememberChoiceFeature || $rememberChoicePerIdp,
7171
showRequestAccess: $displayUnconnectedIdpsWayf,
7272
requestId: 'bogus-request-id',
7373
serviceProvider: TestEntitySeeder::buildSp(),

0 commit comments

Comments
 (0)