Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): refresh T3 Connect switch after startup reconcile #7193

Closedmaslinedwin(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/7193/headopened View on GitHub

Showing 9 changed files with 178 additions and 0 deletions (loading 7).

x
0 of 9 viewed, 9 left
136 additions and 0 deletionsapps/web/src/cloud/connectOnboarding.test.tsAdded
View file
@@ -0,0 +1,136 @@
+import { describe, expect, it } from "vite-plus/test";
+​
+import {
+ resolveOnboardingManagedTunnelActive,
+ resolveOnboardingReconcileDesired,
+ shouldSyncOnboardingToggleFromLinkState,
+} from "./connectOnboarding";
+​
+describe("shouldSyncOnboardingToggleFromLinkState", () => {
+ it("resyncs an untouched toggle for the account being onboarded", () => {
+ expect(
+ shouldSyncOnboardingToggleFromLinkState({
+ touched: false,
+ openForAccount: "user-1",
+ linked: true,
+ cloudUserId: "user-1",
+ }),
+ ).toBe(true);
+ });
+​
+ it("does not overwrite a toggle the user has already changed", () => {
+ expect(
+ shouldSyncOnboardingToggleFromLinkState({
+ touched: true,
+ openForAccount: "user-1",
+ linked: true,
+ cloudUserId: "user-1",
+ }),
+ ).toBe(false);
+ });