mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
[CORL-314] Rename to Coral (#2318)
* chore: rename talk to coral * fix: lint and unit tests * fix: snapshot
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { Environment, RecordSource } from "relay-runtime";
|
||||
import sinon from "sinon";
|
||||
|
||||
import { TalkContext } from "talk-framework/lib/bootstrap";
|
||||
import { LOCAL_ID } from "talk-framework/lib/relay";
|
||||
import { createPromisifiedStorage } from "talk-framework/lib/storage";
|
||||
import { CoralContext } from "coral-framework/lib/bootstrap";
|
||||
import { LOCAL_ID } from "coral-framework/lib/relay";
|
||||
import { createPromisifiedStorage } from "coral-framework/lib/storage";
|
||||
import {
|
||||
createAccessToken,
|
||||
createRelayEnvironment,
|
||||
} from "talk-framework/testHelpers";
|
||||
} from "coral-framework/testHelpers";
|
||||
|
||||
import SetAccessTokenMutation from "./SetAccessTokenMutation";
|
||||
|
||||
@@ -24,7 +24,7 @@ const accessToken = createAccessToken();
|
||||
|
||||
it("Sets auth token to localStorage", async () => {
|
||||
const clearSessionStub = sinon.stub();
|
||||
const context: Partial<TalkContext> = {
|
||||
const context: Partial<CoralContext> = {
|
||||
localStorage: createPromisifiedStorage(),
|
||||
clearSession: clearSessionStub,
|
||||
};
|
||||
@@ -42,7 +42,7 @@ it("Sets auth token to localStorage", async () => {
|
||||
|
||||
it("Removes auth token from localStorage", async () => {
|
||||
const clearSessionStub = sinon.stub();
|
||||
const context: Partial<TalkContext> = {
|
||||
const context: Partial<CoralContext> = {
|
||||
localStorage: createPromisifiedStorage(),
|
||||
clearSession: clearSessionStub,
|
||||
};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Environment } from "relay-runtime";
|
||||
|
||||
import { TalkContext } from "talk-framework/lib/bootstrap";
|
||||
import { CoralContext } from "coral-framework/lib/bootstrap";
|
||||
import {
|
||||
commitLocalUpdatePromisified,
|
||||
createMutation,
|
||||
setAccessTokenInLocalState,
|
||||
} from "talk-framework/lib/relay";
|
||||
} from "coral-framework/lib/relay";
|
||||
|
||||
interface SetAccessTokenInput {
|
||||
accessToken: string | null;
|
||||
@@ -16,7 +16,7 @@ const SetAccessTokenMutation = createMutation(
|
||||
async (
|
||||
environment: Environment,
|
||||
input: SetAccessTokenInput,
|
||||
{ localStorage, clearSession }: TalkContext
|
||||
{ localStorage, clearSession }: CoralContext
|
||||
) => {
|
||||
await commitLocalUpdatePromisified(environment, async store => {
|
||||
setAccessTokenInLocalState(input.accessToken, store);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Environment, RecordSource } from "relay-runtime";
|
||||
|
||||
import { createRelayEnvironment } from "talk-framework/testHelpers";
|
||||
import { createRelayEnvironment } from "coral-framework/testHelpers";
|
||||
|
||||
import { NETWORK_ID, NETWORK_TYPE } from "../lib/relay/localState";
|
||||
import { commit } from "./SetNetworkStatusMutation";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { commitLocalUpdate, Environment } from "relay-runtime";
|
||||
|
||||
import { createMutationContainer } from "talk-framework/lib/relay";
|
||||
import { createMutationContainer } from "coral-framework/lib/relay";
|
||||
|
||||
import { NETWORK_ID } from "../lib/relay/localState";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CoralContext } from "coral-framework/lib/bootstrap";
|
||||
import { createMutationContainer } from "coral-framework/lib/relay";
|
||||
import { Environment } from "relay-runtime";
|
||||
import { TalkContext } from "talk-framework/lib/bootstrap";
|
||||
import { createMutationContainer } from "talk-framework/lib/relay";
|
||||
import signOut from "../rest/signOut";
|
||||
import SetAccessTokenMutation from "./SetAccessTokenMutation";
|
||||
|
||||
@@ -9,7 +9,7 @@ export type SignOutMutation = () => Promise<void>;
|
||||
export async function commit(
|
||||
environment: Environment,
|
||||
input: undefined,
|
||||
ctx: TalkContext
|
||||
ctx: CoralContext
|
||||
) {
|
||||
await signOut(ctx.rest);
|
||||
await SetAccessTokenMutation.commit(environment, { accessToken: "" }, ctx);
|
||||
|
||||
Reference in New Issue
Block a user