<commit_before>Class {
	#name : #PjCounterBrowserAppTest,
	#superclass : #PjAppTestCase,
	#instVars : [
		'application',
		'countDisplay',
		'incrementButton',
		'resetButton'
	],
	#category : #'PharoJsExamples-Counter'
}

{ #category : #'suite parameters' }
PjCounterBrowserAppTest class >> appClass [
	^PjCounterBrowserApp
]

{ #category : #testing }
PjCounterBrowserAppTest class >> isAbstract [
	^self == PjCounterBrowserAppTest
]

{ #category : #testing }
PjCounterBrowserAppTest >> currentApp [
	self subclassResponsibility
]

{ #category : #testing }
PjCounterBrowserAppTest >> setUp [
	super setUp.
	application := self currentApp.
	countDisplay := application countDisplay.
	resetButton := application resetButton.
	incrementButton := application incrementButton.
	
]

{ #category : #testing }
PjCounterBrowserAppTest >> testClickOnIncrementButtonIncreasesCountAndUpdatesDisplay [
	1 to: 10 do: [ : expectedCount |
		incrementButton click.
		self assert: countDisplay innerHTML equals: expectedCount asString
	]

]

{ #category : #testing }
PjCounterBrowserAppTest >> testClickOnResetButtonSetsCountTo0 [
	3 timesRepeat: [incrementButton click.].
	resetButton click.
	self assert: countDisplay innerHTML equals: '0'

]

{ #category : #testing }
PjCounterBrowserAppTest >> testInitialCountDisplayIs0 [
	self assert: countDisplay innerHTML equals: '0'
]
<commit_msg>Make PjCounterBrowserAppTest inherits from the right superclass, that is PjWebAppTestCase<commit_after>Class {
	#name : #PjCounterBrowserAppTest,
	#superclass : #PjWebAppTestCase,
	#instVars : [
		'application',
		'countDisplay',
		'incrementButton',
		'resetButton'
	],
	#category : #'PharoJsExamples-Counter'
}

{ #category : #'suite parameters' }
PjCounterBrowserAppTest class >> appClass [
	^PjCounterBrowserApp
]

{ #category : #testing }
PjCounterBrowserAppTest class >> isAbstract [
	^self == PjCounterBrowserAppTest
]

{ #category : #testing }
PjCounterBrowserAppTest >> currentApp [
	self subclassResponsibility
]

{ #category : #testing }
PjCounterBrowserAppTest >> setUp [
	super setUp.
	application := self currentApp.
	countDisplay := application countDisplay.
	resetButton := application resetButton.
	incrementButton := application incrementButton.
	
]

{ #category : #testing }
PjCounterBrowserAppTest >> testClickOnIncrementButtonIncreasesCountAndUpdatesDisplay [
	1 to: 10 do: [ : expectedCount |
		incrementButton click.
		self assert: countDisplay innerHTML equals: expectedCount asString
	]

]

{ #category : #testing }
PjCounterBrowserAppTest >> testClickOnResetButtonSetsCountTo0 [
	3 timesRepeat: [incrementButton click.].
	resetButton click.
	self assert: countDisplay innerHTML equals: '0'

]

{ #category : #testing }
PjCounterBrowserAppTest >> testInitialCountDisplayIs0 [
	self assert: countDisplay innerHTML equals: '0'
]

{'fraction_non_alphanumeric': 0.09946902654867257, 'fraction_numerical': 0.005663716814159292, 'mean_word_length': 5.728571428571429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3310400', 'n_tokens_mistral': 895, 'n_tokens_neox': 872, 'n_words': 197}