This repository has been archived by the owner on Feb 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Display More Profile Information #486
Merged
linuxwolf
merged 7 commits into
mozilla-lockwise:master
from
linuxwolf:417-fxa-userinfo
Jan 30, 2018
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e771214
(WIP) moar user info
linuxwolf ec6d454
report a default avatar if none available
linuxwolf e919c43
present additional FxA info
linuxwolf 0be9207
address review and testing issues
linuxwolf 9807f59
address css changes
linuxwolf 6ce9406
Merge branch 'master' into 417-fxa-userinfo
linuxwolf 5026c66
Merge branch 'master' into 417-fxa-userinfo
linuxwolf 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 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -112,6 +112,8 @@ describe("background > accounts", () => { | |
const authedInfo = { | ||
...unauthedInfo, | ||
email: "[email protected]", | ||
displayName: "Ellen Ripley", | ||
avatar: "https://avatars.example/92397b7d8b9e510f4266ab9751030c73b3b12cfc.png", | ||
refresh_token: "rmrBzLYi2zia4ExNBy7uXE4s_Da_HMS4d3tvr203OVTq1EMQqh-85m4Hejo3TKBKuont6QFIlLJ23rZR4xqZBA", | ||
expires_at: 1825884426240000, | ||
keys: new Map(), | ||
|
@@ -181,6 +183,42 @@ describe("background > accounts", () => { | |
expect(acct.email).to.equal("[email protected]"); | ||
}); | ||
|
||
it("displayName", () => { | ||
expect(acct.displayName).to.equal(undefined); | ||
acct.info = { ...authedInfo }; | ||
expect(acct.displayName).to.equal("Ellen Ripley"); | ||
delete acct.info.displayName; | ||
expect(acct.displayName).to.equal("[email protected]"); | ||
}); | ||
|
||
it("avatar", () => { | ||
expect(acct.avatar).to.equal(browser.extension.getURL(accounts.DEFAULT_AVATAR_PATH)); | ||
acct.info = authedInfo; | ||
expect(acct.avatar).to.equal("https://avatars.example/92397b7d8b9e510f4266ab9751030c73b3b12cfc.png"); | ||
}); | ||
|
||
it("details", () => { | ||
let actual; | ||
|
||
actual = acct.details(); | ||
expect(actual).to.deep.equal({ | ||
mode: accounts.GUEST, | ||
uid: undefined, | ||
email: undefined, | ||
displayName: undefined, | ||
avatar: browser.extension.getURL(accounts.DEFAULT_AVATAR_PATH), | ||
}); | ||
acct.info = authedInfo; | ||
actual = acct.details(); | ||
expect(actual).to.deep.equal({ | ||
mode: accounts.AUTHENTICATED, | ||
uid: "1234", | ||
email: "[email protected]", | ||
displayName: "Ellen Ripley", | ||
avatar: "https://avatars.example/92397b7d8b9e510f4266ab9751030c73b3b12cfc.png", | ||
}); | ||
}); | ||
|
||
describe("signin/out", () => { | ||
let stubWAF; | ||
|
||
|
@@ -245,6 +283,8 @@ describe("background > accounts", () => { | |
body: { | ||
uid: "1234", | ||
email: "[email protected]", | ||
displayName: "Ellen Ripley", | ||
avatar: "https://avatars.example/92397b7d8b9e510f4266ab9751030c73b3b12cfc.png", | ||
}, | ||
}); | ||
|
||
|
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 |
---|---|---|
|
@@ -14,10 +14,12 @@ chai.use(chaiEnzyme()); | |
describe("list > manage > components > <AccountSummaryLabel />", () => { | ||
it("render <AccountSummaryLabel/>", () => { | ||
const wrapper = mountWithL10n( | ||
<AccountSummaryLabel email="[email protected]"/> | ||
<AccountSummaryLabel displayName="Ellen Ripley" | ||
avatar="https://avatar.example/c49fd653afb7010bd47d5ef81a95d3977803517d.png"/> | ||
); | ||
|
||
expect(wrapper.find("span")).to.have.text("[email protected]"); | ||
expect(wrapper.find("span").at(1)).to.have.text("Ellen Ripley"); | ||
expect(wrapper.find("img")).to.have.prop("src").to.equal("https://avatar.example/c49fd653afb7010bd47d5ef81a95d3977803517d.png"); | ||
}); | ||
|
||
it("render nothing", () => { | ||
|
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 |
---|---|---|
|
@@ -25,6 +25,8 @@ describe("list > manage > containers > <AccountSummary/>", () => { | |
mode: "authenticated", | ||
uid: "1234", | ||
email: "[email protected]", | ||
displayName: "Ellen Ripley", | ||
avatar: "https://avatar.example/c49fd653afb7010bd47d5ef81a95d3977803517d.png", | ||
}, | ||
}); | ||
const wrapper = mountWithL10n( | ||
|
@@ -33,7 +35,8 @@ describe("list > manage > containers > <AccountSummary/>", () => { | |
</Provider> | ||
); | ||
|
||
expect(wrapper.find("span")).to.have.text("[email protected]"); | ||
expect(wrapper.find("span").at(1)).to.have.text("Ellen Ripley"); | ||
expect(wrapper.find("img")).to.have.prop("src").to.equal("https://avatar.example/c49fd653afb7010bd47d5ef81a95d3977803517d.png"); | ||
}); | ||
it("render empty in guest mode", () => { | ||
const store = mockStore(initialState); | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this in the CSS for
<Toolbar/>
(src/webextension/widgets/toolbar.css
); currently, it hasalign-items: baseline
, butalign-items: center
would probably be better...