Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Load in New Image and Run Tests
run: smalltalkci -s ${{ matrix.smalltalk }} ${{ matrix.ston }}
shell: bash
timeout-minutes: 10
timeout-minutes: 15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
6 changes: 3 additions & 3 deletions src/Album-Alexandrie/AlbExamplesSeeClassSide.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ AlbExamplesSeeClassSide class >> example_AlexandrieFixedMeasurer [

| anEditor host |
anEditor := self alexandrieEditorFor: 'Hello'.
host := BlMorphicWindowHost new.
host := BlMorphicWindowHost default.
BlSpace new
in: [ :sp | sp root addChild: anEditor ];
host: host;
Expand All @@ -52,7 +52,7 @@ AlbExamplesSeeClassSide class >> example_AlexandrieFixedMeasurer0 [
fontName: 'Helvetica Neue'.
element := text asElement.
element measurer: self alexandrieFixedMeasurer.
host := BlMorphicWindowHost new.
host := BlMorphicWindowHost default.
BlSpace new in: [ :sp | sp root addChild: element ];
host: host;
title: host asString;
Expand Down Expand Up @@ -87,7 +87,7 @@ TTTCCATTCAGATGCGACCCCAGGTCAGGCGGGGCCACCCGCTGAGTTGAGGC'.
elem measurer: (BATextElementMockedMeasurer new).
root addChild: elem ].

host := BlMorphicWindowHost new.
host := BlMorphicWindowHost default.
space := BlSpace new
host: host;
title: host asString;
Expand Down
99 changes: 0 additions & 99 deletions src/Album-Examples/AlbTextEditorByScripterExamples.class.st

This file was deleted.

4 changes: 4 additions & 0 deletions src/Album-Examples/AlbTextEditorExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
Class {
#name : #AlbTextEditorExamples,
#superclass : #Object,
#classInstVars : [
'loremIpsum'
],
#category : #'Album-Examples-Editor'
}

Expand Down Expand Up @@ -271,6 +274,7 @@ AlbTextEditorExamples class >> loremIpsum [

{ #category : #'examples - comparison' }
AlbTextEditorExamples class >> loremIpsum: aLength [

loremIpsum ifNil: [ loremIpsum := Dictionary new ].
^ loremIpsum
at: aLength asString asSymbol
Expand Down
28 changes: 11 additions & 17 deletions src/Album-Tests/AlbEditorStructureTest.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : #AlbEditorStructureTest,
#superclass : #TestCase,
#superclass : #BlSpaceTestCase,
#instVars : [
'editor'
],
Expand All @@ -9,47 +9,41 @@ Class {

{ #category : #initialization }
AlbEditorStructureTest >> setUp [

super setUp.
space extent: 400 @ 300.
editor := AlbInfiniteEditorElement new.
editor exact: 400 @ 300.
space deferAndSettle: [ space root addChild: editor ]
]

{ #category : #segments }
AlbEditorStructureTest >> test_segments_count0 [

| segments |


segments := editor children
select: [ :eachChild | eachChild isKindOf: AlbTextEditorSegmentElement ].
self assert: segments size equals: 0.
self assert: segments size equals: 1.

editor text: 'A'.
self assert: editor children size isZero.

editor forceLayout.
space deferAndSettle: [ editor text: 'A' ].
self assert: editor children size equals: 1.

segments := editor children
select: [ :eachChild | eachChild isKindOf: AlbTextEditorSegmentElement ].
self assert: segments size equals: 1.

editor text: 'A A'.
self assert: editor children size equals: 1.

editor forceLayout.
space deferAndSettle: [ editor text: 'A A' ].
self assert: editor children size equals: 1.

segments := editor children
select: [ :eachChild | eachChild isKindOf: AlbTextEditorSegmentElement ].
self assert: segments size equals: 1.

editor text: 'A A', String cr.
self assert: editor children size equals: 1.

editor forceLayout.
space deferAndSettle: [ editor text: 'A A', String cr ].
self assert: editor children size equals: 2.

segments := editor children
select: [ :eachChild | eachChild isKindOf: AlbTextEditorSegmentElement ].
self assert: segments size equals: 2.

self assert: editor children size equals: 2
]
121 changes: 121 additions & 0 deletions src/Album-Tests/AlbTextEditorByScripterTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
Class {
#name : #AlbTextEditorByScripterTest,
#superclass : #TestCase,
#instVars : [
'scripter'
],
#category : #'Album-Tests'
}

{ #category : #running }
AlbTextEditorByScripterTest >> setUp [

super setUp.
scripter := BlDevScripter new
]

{ #category : #running }
AlbTextEditorByScripterTest >> tearDown [

scripter close.
super tearDown
]

{ #category : #tests }
AlbTextEditorByScripterTest >> testClickRequestsFocus [

scripter element:
(AlbEditorElement new
text: '' asRopedText;
yourself).

scripter check
value: [ :aAlbTextEditor | aAlbTextEditor cursor position ] equals: 0;
onAlbum.

scripter check
satisfies: [ :aAlbEditor | aAlbEditor hasFocus not ];
onSelf.

scripter click onSelf.

scripter check
value: [ :aAlbTextEditor | aAlbTextEditor cursor position ] equals: 0;
onAlbum.

scripter check
satisfies: [ :aAlbEditor | aAlbEditor hasFocus ];
onSelf.

scripter syncPlay
]

{ #category : #tests }
AlbTextEditorByScripterTest >> testCursorMovementAndInsert [

scripter element:
(AlbEditorElement new
text: '' asRopedText;
yourself).

scripter click onSelf.
scripter type: 'Hello'.
scripter keyClick: KeyboardKey left.
scripter keyClick: KeyboardKey left.
scripter type: 'x'.

scripter check
value: [ :aAlbTextEditor | aAlbTextEditor text asString ] equals: 'Helxlo';
onAlbum.

scripter check
value: [ :aAlbTextEditor | aAlbTextEditor cursor position ] equals: 4;
onAlbum.

scripter syncPlay
]

{ #category : #tests }
AlbTextEditorByScripterTest >> testTypeAndBackspace [

scripter element:
(AlbEditorElement new
text: '' asRopedText;
yourself).

scripter click onSelf.
scripter type: 'Hello'.
scripter keyClick: KeyboardKey backspace.

scripter check
value: [ :aAlbTextEditor | aAlbTextEditor text asString ] equals: 'Hell';
onAlbum.

scripter check
value: [ :aAlbTextEditor | aAlbTextEditor cursor position ] equals: 4;
onAlbum.

scripter syncPlay
]

{ #category : #tests }
AlbTextEditorByScripterTest >> testTypeText [

scripter element:
(AlbEditorElement new
text: '' asRopedText;
yourself).

scripter click onSelf.
scripter type: 'Hello'.

scripter check
value: [ :aAlbTextEditor | aAlbTextEditor text asString ] equals: 'Hello';
onAlbum.

scripter check
value: [ :aAlbTextEditor | aAlbTextEditor cursor position ] equals: 5;
onAlbum.

scripter syncPlay
]
Loading