-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(sdk): for each component define reset function. Reuse it in glo…
…bal reset function
- Loading branch information
Showing
16 changed files
with
308 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/sdk/src/scopes/components/back-button/resetBackButton.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,7 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { isMounted, isVisible } from './back-button.js'; | ||
|
||
export function resetBackButton() { | ||
[isVisible, isMounted].forEach(resetSignal); | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/sdk/src/scopes/components/biometry/resetBiometry.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,21 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { | ||
isMounted, | ||
state, | ||
mountError, | ||
isMounting, | ||
isRequestingAccess, | ||
isAuthenticating, | ||
} from './signals.js'; | ||
|
||
export function resetBiometry() { | ||
[ | ||
isMounted, | ||
state, | ||
mountError, | ||
isMounting, | ||
isRequestingAccess, | ||
isAuthenticating, | ||
].forEach(resetSignal); | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/sdk/src/scopes/components/closing-behavior/resetClosingBehavior.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,7 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { isMounted, isConfirmationEnabled } from './closing-behavior.js'; | ||
|
||
export function resetClosingBehavior() { | ||
[isMounted, isConfirmationEnabled].forEach(resetSignal); | ||
} |
35 changes: 35 additions & 0 deletions
35
packages/sdk/src/scopes/components/init-data/resetInitData.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,35 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { | ||
raw, | ||
state, | ||
authDate, | ||
canSendAfterDate, | ||
canSendAfter, | ||
startParam, | ||
receiver, | ||
queryId, | ||
chat, | ||
chatType, | ||
chatInstance, | ||
hash, | ||
user, | ||
} from './init-data.js'; | ||
|
||
export function resetInitData() { | ||
[ | ||
raw, | ||
state, | ||
authDate, | ||
canSendAfterDate, | ||
canSendAfter, | ||
startParam, | ||
receiver, | ||
queryId, | ||
chat, | ||
chatType, | ||
chatInstance, | ||
hash, | ||
user, | ||
].forEach(resetSignal); | ||
} |
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,7 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { isOpened } from './invoice.js'; | ||
|
||
export function resetInvoice() { | ||
[isOpened].forEach(resetSignal); | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/sdk/src/scopes/components/main-button/resetMainButton.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,29 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { | ||
isMounted, | ||
isVisible, | ||
state, | ||
isLoaderVisible, | ||
isEnabled, | ||
hasShineEffect, | ||
text, | ||
textColor, | ||
backgroundColor, | ||
internalState, | ||
} from './signals.js'; | ||
|
||
export function resetMainButton() { | ||
[ | ||
isMounted, | ||
isVisible, | ||
state, | ||
isLoaderVisible, | ||
isEnabled, | ||
hasShineEffect, | ||
text, | ||
textColor, | ||
backgroundColor, | ||
internalState, | ||
].forEach(resetSignal); | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/sdk/src/scopes/components/mini-app/resetMiniApp.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,29 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { | ||
isMounted, | ||
state, | ||
backgroundColor, | ||
backgroundColorRGB, | ||
bottomBarColorRGB, | ||
headerColorRGB, | ||
bottomBarColor, | ||
headerColor, | ||
isCssVarsBound, | ||
isDark, | ||
} from './signals.js'; | ||
|
||
export function resetMiniApp() { | ||
[ | ||
isMounted, | ||
state, | ||
backgroundColor, | ||
backgroundColorRGB, | ||
bottomBarColorRGB, | ||
headerColorRGB, | ||
bottomBarColor, | ||
headerColor, | ||
isCssVarsBound, | ||
isDark, | ||
].forEach(resetSignal); | ||
} |
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,7 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { isOpened } from './popup.js'; | ||
|
||
export function resetPopup() { | ||
[isOpened].forEach(resetSignal); | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/sdk/src/scopes/components/qr-scanner/resetQrScanner.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,7 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { isOpened } from './qr-scanner.js'; | ||
|
||
export function resetQrScanner() { | ||
[isOpened].forEach(resetSignal); | ||
} |
31 changes: 31 additions & 0 deletions
31
packages/sdk/src/scopes/components/secondary-button/resetSecondaryButton.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,31 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { | ||
isMounted, | ||
isVisible, | ||
state, | ||
internalState, | ||
text, | ||
textColor, | ||
backgroundColor, | ||
hasShineEffect, | ||
isEnabled, | ||
isLoaderVisible, | ||
position, | ||
} from './signals.js'; | ||
|
||
export function resetSecondaryButton() { | ||
[ | ||
isMounted, | ||
isVisible, | ||
state, | ||
internalState, | ||
text, | ||
textColor, | ||
backgroundColor, | ||
hasShineEffect, | ||
isEnabled, | ||
isLoaderVisible, | ||
position, | ||
].forEach(resetSignal); | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/sdk/src/scopes/components/settings-button/resetSettingsButton.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,7 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { isMounted, isVisible } from './settings-button.js'; | ||
|
||
export function resetSettingsButton() { | ||
[isMounted, isVisible].forEach(resetSignal); | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/sdk/src/scopes/components/swipe-behavior/resetSwipeBehavior.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,7 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { isMounted, isVerticalEnabled } from './swipe-behavior.js'; | ||
|
||
export function resetSwipeBehavior() { | ||
[isMounted, isVerticalEnabled].forEach(resetSignal); | ||
} |
47 changes: 47 additions & 0 deletions
47
packages/sdk/src/scopes/components/theme-params/resetThemeParams.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,47 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { | ||
state, | ||
isMounted, | ||
isCssVarsBound, | ||
isDark, | ||
textColor, | ||
backgroundColor, | ||
buttonTextColor, | ||
buttonColor, | ||
secondaryBackgroundColor, | ||
headerBackgroundColor, | ||
linkColor, | ||
destructiveTextColor, | ||
sectionBackgroundColor, | ||
sectionSeparatorColor, | ||
subtitleTextColor, | ||
accentTextColor, | ||
hintColor, | ||
sectionHeaderTextColor, | ||
bottomBarBgColor, | ||
} from './signals.js'; | ||
|
||
export function resetThemeParams() { | ||
[ | ||
state, | ||
isMounted, | ||
isCssVarsBound, | ||
isDark, | ||
textColor, | ||
backgroundColor, | ||
buttonTextColor, | ||
buttonColor, | ||
secondaryBackgroundColor, | ||
headerBackgroundColor, | ||
linkColor, | ||
destructiveTextColor, | ||
sectionBackgroundColor, | ||
sectionSeparatorColor, | ||
subtitleTextColor, | ||
accentTextColor, | ||
hintColor, | ||
sectionHeaderTextColor, | ||
bottomBarBgColor, | ||
].forEach(resetSignal); | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/sdk/src/scopes/components/viewport/resetViewport.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,29 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { | ||
state, | ||
mountError, | ||
isMounted, | ||
isCssVarsBound, | ||
isMounting, | ||
width, | ||
isExpanded, | ||
height, | ||
stableHeight, | ||
isStable, | ||
} from './signals.js'; | ||
|
||
export function resetViewport() { | ||
[ | ||
state, | ||
mountError, | ||
isMounted, | ||
isCssVarsBound, | ||
isMounting, | ||
width, | ||
isExpanded, | ||
height, | ||
stableHeight, | ||
isStable, | ||
].forEach(resetSignal); | ||
} |
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,7 @@ | ||
import { resetSignal } from '@test-utils/reset.js'; | ||
|
||
import { isRequestingPhoneAccess, isRequestingWriteAccess } from './privacy.js'; | ||
|
||
export function resetPrivacy() { | ||
[isRequestingPhoneAccess, isRequestingWriteAccess].forEach(resetSignal); | ||
} |
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