Repository navigation
Phase 19a: what Nextcloud Social 0.26.126 fixed, taken up by the app #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b726cd8
fix(profile): a save that fails is a failure
AndyScherzinger 0d442c3
docs(server): a new account answers at once on Social 0.26.119
AndyScherzinger c81fd44
fix(network): a placeholder picture is not the account's own
AndyScherzinger 768b20e
docs: Social 0.26.126 as the app uses it, and Phase 19a built
AndyScherzinger 1c808f9
test(sync): the thirty-second wait allows for however long the run took
AndyScherzinger 97c025d
feat(profile): search a profile's posts on Nextcloud Social too
AndyScherzinger 78d69d1
feat(thread): the edit history says what each version's pictures say
AndyScherzinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
53 changes: 53 additions & 0 deletions
53
core/data/src/test/kotlin/social/aloha/core/data/profile/OwnProfileTest.kt
This file contains hidden or 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,53 @@ | ||
| // SPDX-FileCopyrightText: 2026 Aloha Social contributors | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| package social.aloha.core.data.profile | ||
|
|
||
| import android.content.Context | ||
| import androidx.test.core.app.ApplicationProvider | ||
| import java.util.concurrent.CopyOnWriteArrayList | ||
| import kotlinx.coroutines.runBlocking | ||
| import mockwebserver3.Dispatcher | ||
| import mockwebserver3.MockResponse | ||
| import mockwebserver3.MockWebServer | ||
| import mockwebserver3.RecordedRequest | ||
| import org.junit.After | ||
| import org.junit.Assert.assertEquals | ||
| import org.junit.Assert.assertTrue | ||
| import org.junit.Test | ||
| import org.junit.runner.RunWith | ||
| import org.robolectric.RobolectricTestRunner | ||
| import social.aloha.core.data.Answer | ||
| import social.aloha.core.network.ApiError | ||
| import social.aloha.core.network.endpoints.CredentialsUpdate | ||
| import social.aloha.core.testing.SignedInFixture | ||
|
|
||
| @RunWith(RobolectricTestRunner::class) | ||
| class OwnProfileTest { | ||
| private val context = ApplicationProvider.getApplicationContext<Context>() | ||
| private val fixture = SignedInFixture(context) | ||
| private val asked = CopyOnWriteArrayList<String>() | ||
| private val server = MockWebServer().apply { | ||
| dispatcher = object : Dispatcher() { | ||
| override fun dispatch(request: RecordedRequest): MockResponse { | ||
| asked += "${request.method} ${request.url.encodedPath}" | ||
| return MockResponse.Builder().code(500).body("{}").build() | ||
| } | ||
| } | ||
| start() | ||
| } | ||
|
|
||
| @After | ||
| fun close() { | ||
| fixture.close() | ||
| server.close() | ||
| } | ||
|
|
||
| @Test | ||
| fun `a save the server fails is a failure, not looked up again`() = runBlocking { | ||
| val reader = fixture.signIn(server.url("/")) | ||
| val saved = fixture.ownProfile.save(reader, CredentialsUpdate(displayName = "Alice"), false, false) | ||
| assertTrue((saved as Answer.Missed).error is ApiError.Server) | ||
| assertEquals(listOf("PATCH /api/v1/accounts/update_credentials"), asked) | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.