-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #650 from Telegram-Mini-Apps/feature/location-mana…
…ger-open-settings feat(sdk): implement locationManager.openSettings. Export it and the unmount function
- Loading branch information
Showing
5 changed files
with
58 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@telegram-apps/sdk": minor | ||
--- | ||
|
||
Implement `locationManager.openSettings` method. Exports location manager's `unmount` method. Fix invalid method name for `requestLocation` |
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 |
---|---|---|
|
@@ -12,4 +12,6 @@ export { | |
requestLocation, | ||
mountPromise, | ||
isAvailable, | ||
openSettings, | ||
unmount, | ||
} from './location-manager.js'; |
28 changes: 28 additions & 0 deletions
28
packages/sdk/src/scopes/components/location-manager/location-manager.test.ts
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,28 @@ | ||
import { beforeEach, describe, vi } from 'vitest'; | ||
|
||
import { testSafety } from '@test-utils/predefined/testSafety.js'; | ||
import { | ||
openSettings, | ||
requestLocation, | ||
mount, | ||
_isMounted, | ||
} from '@/scopes/components/location-manager/location-manager.js'; | ||
import { mockPostEvent, resetPackageState } from '@test-utils/utils.js'; | ||
|
||
beforeEach(() => { | ||
resetPackageState(); | ||
vi.restoreAllMocks(); | ||
mockPostEvent(); | ||
}); | ||
|
||
describe.each([ | ||
['requestLocation', requestLocation, _isMounted], | ||
['openSettings', openSettings, undefined], | ||
['mount', mount, undefined], | ||
] as const)('%s', (name, fn, isMounted) => { | ||
testSafety(fn, name, { | ||
component: 'locationManager', | ||
minVersion: '8.0', | ||
isMounted, | ||
}); | ||
}); |
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