From 96f558a40b63e1b1837db6e084d778eddd74fdf9 Mon Sep 17 00:00:00 2001 From: Maximiliano Tabacman Date: Mon, 1 Jul 2024 16:12:56 -0300 Subject: [PATCH] Fixed tests that were affected by Seaside escaping / --- ...inedWebInteractionInterpreterTest.class.st | 23 +++++++++---------- .../DialogOpeningCommandTest.class.st | 19 ++++++++------- .../LoadingNotificationCommandTest.class.st | 20 +++++++++------- .../PeriodicallyRenderedWebViewTest.class.st | 20 ++++++++-------- .../RenderingCommandTest.class.st | 17 +++++++------- .../TemporarilyDisablingCommandTest.class.st | 23 +++++++++---------- .../WebInteractionInterpreterTest.class.st | 4 ++-- 7 files changed, 64 insertions(+), 62 deletions(-) diff --git a/source/Willow-Core-Tests/CombinedWebInteractionInterpreterTest.class.st b/source/Willow-Core-Tests/CombinedWebInteractionInterpreterTest.class.st index 93179646..a26ece19 100644 --- a/source/Willow-Core-Tests/CombinedWebInteractionInterpreterTest.class.st +++ b/source/Willow-Core-Tests/CombinedWebInteractionInterpreterTest.class.st @@ -697,14 +697,14 @@ CombinedWebInteractionInterpreterTest >> testShowLoadingNotificationDisplayingAp showLoadingNotificationDisplaying: 'Loading...' applying: [ :view | view addClass willow ]. html := self renderUsing: [ :canvas | - canvas - render: okButton; - render: cancelButton + canvas + render: okButton; + render: cancelButton ]. self assert: html equals: - '' + '' ] { #category : 'tests - Configuring - DOM' } @@ -714,17 +714,16 @@ CombinedWebInteractionInterpreterTest >> testShowLoadingNotificationStyledAsAll interpreter := self combinedInterpreter. - interpreter showLoadingNotificationStyledAsAll: #(). - html := self - renderUsing: [ :canvas | - canvas - render: okButton; - render: cancelButton - ]. + interpreter showLoadingNotificationStyledAsAll: #( ). + html := self renderUsing: [ :canvas | + canvas + render: okButton; + render: cancelButton + ]. self assert: html equals: - '' + '' ] { #category : 'tests - Configuring - DOM' } diff --git a/source/Willow-Core-Tests/DialogOpeningCommandTest.class.st b/source/Willow-Core-Tests/DialogOpeningCommandTest.class.st index 1c9b4ed4..8e5ff585 100644 --- a/source/Willow-Core-Tests/DialogOpeningCommandTest.class.st +++ b/source/Willow-Core-Tests/DialogOpeningCommandTest.class.st @@ -24,21 +24,20 @@ DialogOpeningCommandTest >> testModelLoadingInstructions [ | html | - html := self - renderUsing: [ :canvas | - | script anchor | + html := self renderUsing: [ :canvas | + | script anchor | - script := canvas javascript. - anchor := canvas anchor. - canvas ensureIdFor: anchor. - command modelLoadingInstructions appendTo: script on: canvas. - anchor script: ( canvas jQuery this onClick: script ) - ]. + script := canvas javascript. + anchor := canvas anchor. + canvas ensureIdFor: anchor. + command modelLoadingInstructions appendTo: script on: canvas. + anchor script: ( canvas jQuery this onClick: script ) + ]. self assert: html equals: - '' + '' ] { #category : 'tests-accessing' } diff --git a/source/Willow-Core-Tests/LoadingNotificationCommandTest.class.st b/source/Willow-Core-Tests/LoadingNotificationCommandTest.class.st index 056b1d49..c224ffef 100644 --- a/source/Willow-Core-Tests/LoadingNotificationCommandTest.class.st +++ b/source/Willow-Core-Tests/LoadingNotificationCommandTest.class.st @@ -49,28 +49,32 @@ LoadingNotificationCommandTest >> testModelLoadingInstructions [ LoadingNotificationCommandTest >> testPriorityActions [ | command html | - - command := LoadingNotificationCommand onPageTopWithClasses: #(). - + + command := LoadingNotificationCommand onPageTopWithClasses: #( ). + html := self renderedContentUsingPriorityActionsOf: command. self assert: html - equals: '' + equals: + '' ] { #category : 'tests-accessing' } LoadingNotificationCommandTest >> testPriorityActionsWithCustomView [ | command html | - - command := LoadingNotificationCommand displaying: [ :canvas | canvas span: 'Processing...' ] applying: [ :div | div addClass loading ]. - + + command := LoadingNotificationCommand + displaying: [ :canvas | canvas span: 'Processing...' ] + applying: [ :div | div addClass loading ]. + html := self renderedContentUsingPriorityActionsOf: command. self assert: html - equals: '' + equals: + '' ] { #category : 'tests-testing' } diff --git a/source/Willow-Core-Tests/PeriodicallyRenderedWebViewTest.class.st b/source/Willow-Core-Tests/PeriodicallyRenderedWebViewTest.class.st index 7e0f3b7b..20cbab16 100644 --- a/source/Willow-Core-Tests/PeriodicallyRenderedWebViewTest.class.st +++ b/source/Willow-Core-Tests/PeriodicallyRenderedWebViewTest.class.st @@ -80,19 +80,21 @@ PeriodicallyRenderedWebViewTest >> testScriptToRefreshAndRenderContentOn [ counter := 0. periodicallyRenderedView := PeriodicallyRenderedWebView - evaluating: [ counter := counter + 1 ] - every: 500 - millisecondsThenRendering: [ :canvas | - canvas - render: 'Count: '; - render: counter; - break ]. + evaluating: [ counter := counter + 1 ] + every: 500 + millisecondsThenRendering: [ :canvas | + canvas + render: 'Count: '; + render: counter; + break + ]. self render: periodicallyRenderedView. "This is kind of hacky but there's no other way to test it without a proper AJAX call" - html := self renderUsing: [ :canvas | canvas div script: (periodicallyRenderedView scriptToRefreshAndRenderContentOn: canvas) ]. + html := self renderUsing: [ :canvas | + canvas div script: ( periodicallyRenderedView scriptToRefreshAndRenderContentOn: canvas ) ]. self assert: html equals: - '
");' + '
' ] diff --git a/source/Willow-Core-Tests/RenderingCommandTest.class.st b/source/Willow-Core-Tests/RenderingCommandTest.class.st index aa028f12..e49421bc 100644 --- a/source/Willow-Core-Tests/RenderingCommandTest.class.st +++ b/source/Willow-Core-Tests/RenderingCommandTest.class.st @@ -29,20 +29,19 @@ RenderingCommandTest >> testModelLoadingInstructions [ | html | - html := self - renderUsing: [ :canvas | - | script | + html := self renderUsing: [ :canvas | + | script | - script := canvas javascript. - identifiedView identifierOn: canvas. - command modelLoadingInstructions appendTo: script on: canvas. - canvas anchor script: ( canvas jQuery this onClick: script ) - ]. + script := canvas javascript. + identifiedView identifierOn: canvas. + command modelLoadingInstructions appendTo: script on: canvas. + canvas anchor script: ( canvas jQuery this onClick: script ) + ]. self assert: html equals: - '' + '' ] { #category : 'tests-accessing' } diff --git a/source/Willow-Core-Tests/TemporarilyDisablingCommandTest.class.st b/source/Willow-Core-Tests/TemporarilyDisablingCommandTest.class.st index 28f1519b..839b7077 100644 --- a/source/Willow-Core-Tests/TemporarilyDisablingCommandTest.class.st +++ b/source/Willow-Core-Tests/TemporarilyDisablingCommandTest.class.st @@ -20,23 +20,22 @@ TemporarilyDisablingCommandTest >> testPriorityActions [ | command html | - command := TemporarilyDisablingCommand - transformingCurrentViewInto: [ :canvas | canvas span apply: [ :span | span addClass loading ] ]. - html := self - renderUsing: [ :canvas | - | asynchronousCall anchor | + command := TemporarilyDisablingCommand transformingCurrentViewInto: [ :canvas | + canvas span apply: [ :span | span addClass loading ] ]. + html := self renderUsing: [ :canvas | + | asynchronousCall anchor | - asynchronousCall := canvas jQuery ajax. - command priorityActions do: [ :action | action value: asynchronousCall value: canvas ]. - anchor := canvas anchor. - canvas ensureIdFor: anchor. - anchor script: ( canvas jQuery this onClick: asynchronousCall ) - ]. + asynchronousCall := canvas jQuery ajax. + command priorityActions do: [ :action | action value: asynchronousCall value: canvas ]. + anchor := canvas anchor. + canvas ensureIdFor: anchor. + anchor script: ( canvas jQuery this onClick: asynchronousCall ) + ]. self assert: html equals: - '' + '' ] { #category : 'tests-testing' } diff --git a/source/Willow-Core-Tests/WebInteractionInterpreterTest.class.st b/source/Willow-Core-Tests/WebInteractionInterpreterTest.class.st index c2c5ecaf..62dffe13 100644 --- a/source/Willow-Core-Tests/WebInteractionInterpreterTest.class.st +++ b/source/Willow-Core-Tests/WebInteractionInterpreterTest.class.st @@ -753,7 +753,7 @@ WebInteractionInterpreterTest >> testShowLoadingNotificationDisplayingApplying [ self assert: html equals: - '' + '' ] { #category : 'tests - Configuring - DOM' } @@ -769,7 +769,7 @@ WebInteractionInterpreterTest >> testShowLoadingNotificationStyledAsAll [ self assert: html equals: - '' + '' ] { #category : 'tests - Configuring - DOM' }