generated from StanfordBDHG/SwiftPackageTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure name is updated after anonymous account linking (#36)
# Ensure name is updated after anonymous account linking ## ♻️ Current situation & Problem As described in #35, the displayName is not updated in the signup code path that handles linking signup credentials with an existing anonymous account. This PR fixes this issue by updating the display name of the anonymous account if the signup request provides a display name. ## ⚙️ Release Notes * Fixed an issue where the displayName was not updated when signing in by linking against an anonymous user account. ## 📚 Documentation -- ## ✅ Testing A regression test was added that verifies this behavior. ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
- Loading branch information
Showing
7 changed files
with
88 additions
and
38 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
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
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 |
---|---|---|
|
@@ -445,6 +445,30 @@ final class FirebaseAccountTests: XCTestCase { // swiftlint:disable:this type_bo | |
|
||
app.tap() // that triggers the interruption monitor closure | ||
} | ||
|
||
func testSignupAccountLinking() throws { | ||
let app = XCUIApplication() | ||
app.launchArguments = ["--account-storage"] | ||
app.launch() | ||
|
||
XCTAssert(app.buttons["FirebaseAccount"].waitForExistence(timeout: 10.0)) | ||
app.buttons["FirebaseAccount"].tap() | ||
|
||
if app.buttons["Logout"].waitForExistence(timeout: 3.0) && app.buttons["Logout"].isHittable { | ||
app.buttons["Logout"].tap() | ||
} | ||
|
||
XCTAssertTrue(app.buttons["Login Anonymously"].waitForExistence(timeout: 2.0)) | ||
app.buttons["Login Anonymously"].tap() | ||
|
||
XCTAssertTrue(app.staticTexts["User, Anonymous"].waitForExistence(timeout: 5.0)) | ||
|
||
try app.signup(username: "[email protected]", password: "TestPassword2", givenName: "Leland", familyName: "Stanford", biography: "Bio") | ||
|
||
app.buttons["Account Overview"].tap() | ||
XCTAssert(app.staticTexts["Leland Stanford"].waitForExistence(timeout: 2.0)) | ||
XCTAssert(app.staticTexts["Biography, Bio"].exists) | ||
} | ||
} | ||
|
||
|
||
|
@@ -494,3 +518,4 @@ extension XCUIApplication { | |
buttons["Close"].tap() | ||
} | ||
} | ||
// swiftlint:disable:this file_length |
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