-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add lock for private orgs on own profile #1490
Merged
sindresorhus
merged 14 commits into
refined-github:master
from
aramperes:mark-private-orgs
Sep 11, 2018
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
52f05fc
Add lock for private orgs on own profile
aramperes 08e0407
Fix lint issues
aramperes b29a2c1
Improve looks
aramperes 86a9663
Add outline to lock
aramperes 3007104
Add readme entry
aramperes d749fca
Address some review comments
aramperes 5f1e740
Lint
aramperes 565d858
Proper SVG resizing, readme adjustment
aramperes 15eed7a
Fix tests
aramperes d8d60ba
Properly fix tests, revert workaround
aramperes 6c52679
Extra line
aramperes c4f5e56
Add some more mock globals
aramperes b979f6e
Merge branch 'master' into mark-private-orgs
sindresorhus 29453ae
Update mark-private-orgs.js
sindresorhus File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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 |
---|---|---|
|
@@ -142,9 +142,9 @@ export const flatZip = (table, limit = Infinity) => { | |
return zipped; | ||
}; | ||
|
||
export const isMac = /Mac/.test(window.navigator.platform); | ||
export const isMac = () => /Mac/.test(window.navigator.platform); | ||
|
||
export const metaKey = isMac ? 'metaKey' : 'ctrlKey'; | ||
export const metaKey = () => isMac() ? 'metaKey' : 'ctrlKey'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not affecting the tests. |
||
|
||
export const anySelector = selector => { | ||
const prefix = document.head.style.MozOrient === '' ? 'moz' : 'webkit'; | ||
|
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.
I prefer not having to change code because of testing. I already commented a way to fix this properly.
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.
Like I said, the issue itself isn't because of a missing mock for the platform property, but rather that the
window
global isn't initialized when theutils
file is imported.I tried creating a new file which sets the
window
global mocks, and is imported before thepage-detect
file. That didn't appear to solve the issue, as theutils
file is being imported from somewhere else (?)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.
Tests should be fixed properly now, and I reverted the workaround.
e: looks like some more things need to be mocked