File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,23 +21,23 @@ export function sendSuccess (test) {
2121 } )
2222}
2323
24- function applyTreatment ( toggleButton ) {
24+ function applyTreatment ( ) {
2525 // Treatment-specific options.
2626 const hideImagesByDefault = true
2727 const focusButtonByDefault = true
2828
29+ // Run toggleImages a second time on each page, but with treatment defaults.
2930 toggleImages ( hideImagesByDefault , focusButtonByDefault )
3031}
3132
3233export default function ( ) {
33- // *** Example test code ***
3434 const testName = 'toggle-images'
35- const xbucket = process . env . TEST_TREATMENT
36- ? 'TREATMENT'
37- : bucket ( testName )
38- const x = document . getElementById ( 'js-toggle-images' )
39- if ( ! x ) return
40-
41- x . addEventListener ( 'click' , ( ) => { sendSuccess ( testName ) } )
42- if ( xbucket === TREATMENT ) applyTreatment ( x )
35+ const xbucket = bucket ( testName )
36+
37+ const toggleImagesBtn = document . getElementById ( 'js-toggle-images' )
38+ if ( ! toggleImagesBtn ) return
39+
40+ toggleImagesBtn . addEventListener ( 'click' , ( ) => { sendSuccess ( testName ) } )
41+
42+ if ( xbucket === TREATMENT ) applyTreatment ( )
4343}
You can’t perform that action at this time.
0 commit comments