-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename UserStore, add some tests and rename linter method * fix failed rename operation on squeaks behalf
- Loading branch information
1 parent
8ab9159
commit 9557bb5
Showing
29 changed files
with
87 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/TelegramClientTests-Core.package/TCTCAPITests.class/instance/testCanRequestUser.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
testing | ||
testCanRequestUser | ||
|
||
| callbackID user | | ||
|
||
user := nil. | ||
|
||
callbackID := self sharedCore | ||
registerCallback: | ||
[:userEvent | user := TCCUser newFrom: userEvent]. | ||
|
||
self sharedCore requestUser: self sharedCore loggedInUserID with: callbackID. | ||
1 second wait. | ||
|
||
self assert: user notNil. | ||
self assert: self sharedCore loggedInUserID equals: user id. | ||
self assert: user firstName isString. | ||
self assert: user lastName isString. | ||
self assert: user username isString. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...egramClientTests-Core.package/TCTCCoreTests.class/instance/partialGroupMembersTestFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...TelegramClientTests-Core.package/TCTCImageStoreTests.class/instance/testCachesRequests.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
testing | ||
testCachesRequests | ||
|
||
| path1 path2 | | ||
self mockTeleClient onRequestType: 'downloadFile' respond: TCTMMocks mockImageResponseJson. | ||
|
||
[self core imageStore getFormFor: TCTMMocks mockImageId.] fork. | ||
1 seconds wait. | ||
path1 := (self core imageStore at: TCTMMocks mockImageId) value. | ||
|
||
[self core imageStore getFormFor: TCTMMocks mockImageId.] fork. | ||
1 seconds wait. | ||
path2 := (self core imageStore at: TCTMMocks mockImageId) value. | ||
|
||
self assert: path1 equals: path2. | ||
self assert: 1 equals: self core imageStore size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
.../TelegramClientTests-Core.package/TCTCUserStoreTests.class/instance/testCachesRequests.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
testing | ||
testCachesRequests | ||
|
||
| user1 user2 | | ||
user1 := nil. | ||
user2 := nil. | ||
|
||
self mockTeleClient onRequestType: 'getUser' respond: TCTMMocks mockUserJson1. | ||
|
||
[user1 := self core users getUserFor: TCTMMocks mockUser1 id.] fork. | ||
1 seconds wait. | ||
|
||
self assert: user1 notNil. | ||
[user2 := self core users getUserFor: TCTMMocks mockUser1 id.] fork. | ||
1 seconds wait. | ||
|
||
self assert: user1 == user2. |
12 changes: 12 additions & 0 deletions
12
...ages/TelegramClientTests-Core.package/TCTCUserStoreTests.class/instance/testGetUserFor.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
testing | ||
testGetUserFor | ||
|
||
| user | | ||
user := nil. | ||
|
||
self mockTeleClient onRequestType: 'getUser' respond: TCTMMocks mockUserJson1. | ||
|
||
[user := self core users getUserFor: TCTMMocks mockUser1 id.] fork. | ||
1 seconds wait. | ||
|
||
self assert: TCTMMocks mockUser1 equals: user. |
6 changes: 6 additions & 0 deletions
6
packages/TelegramClientTests-Core.package/TCTCUserStoreTests.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"testCachesRequests" : "RS 6/23/2021 15:35", | ||
"testGetUserFor" : "RS 6/23/2021 15:32" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
packages/TelegramClientTests-Core.package/TCTCUsersTests.class/instance/testGetUserFor.st
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
packages/TelegramClientTests-Core.package/TCTCUsersTests.class/methodProperties.json
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...nstance/testMethodNotTooManyEmptyLines.st → ...ance/testMethodNoConsecutiveEmptyLines.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...TCTMMocks.class/class/mockUserPromises.st → ...ge/TCTMMocks.class/class/mockUserStore.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
user | ||
mockUserPromises | ||
mockUserStore | ||
|
||
^ TCCUsers newFrom: { | ||
^ TCCUserStore newFrom: { | ||
self mockUser1 id -> (Promise new resolveWith: self mockUser1). | ||
self mockUser2 id -> (Promise new resolveWith: self mockUser2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters