diff --git a/app/.env-example.env b/app/.env-example.env index 4ec4da3088..a032d26cde 100644 --- a/app/.env-example.env +++ b/app/.env-example.env @@ -3,7 +3,6 @@ NEXT_PUBLIC_PASSPORT_GOOGLE_CLIENT_ID=MY-APP-ID.apps.googleusercontent.com NEXT_PUBLIC_PASSPORT_GOOGLE_CALLBACK=http://localhost:3000/ NEXT_PUBLIC_PASSPORT_TWITTER_CLIENT_ID=ABC123456789 -NEXT_PUBLIC_PASSPORT_FACEBOOK_APP_ID=123456789 NEXT_PUBLIC_PASSPORT_GITHUB_CLIENT_ID=12345678 NEXT_PUBLIC_PASSPORT_GITHUB_CALLBACK=http://localhost:3000/ NEXT_PUBLIC_PASSPORT_LINKEDIN_CLIENT_ID=12345678 diff --git a/app/__test-fixtures__/contextTestHelpers.tsx b/app/__test-fixtures__/contextTestHelpers.tsx index 9ccb463c51..86ae92c199 100644 --- a/app/__test-fixtures__/contextTestHelpers.tsx +++ b/app/__test-fixtures__/contextTestHelpers.tsx @@ -46,14 +46,6 @@ export const makeTestCeramicContext = (initialState?: Partial { - it("should display a facebook verification button", () => { - // renderWithContext(mockUserContext, mockCeramicContext, ); - // const verifyFacebookButton = screen.queryByTestId("button-verify-facebook"); - // expect(verifyFacebookButton).toBeInTheDocument(); - }); -}); - -// describe("when user has verified with FacebookProvider", () => { -// it("should display that facebook is verified", () => { -// renderWithContext( -// mockUserContext, -// { -// ...mockCeramicContext, -// allProvidersState: { -// Facebook: { -// providerSpec: STAMP_PROVIDERS.Facebook, -// stamp: facebookStampFixture, -// }, -// }, -// }, -// -// ); - -// const facebookVerified = screen.queryByText(/Verified/); - -// expect(facebookVerified).toBeInTheDocument(); -// }); - -// it("should be able to delete the stamp", async () => { -// const mockHandleDeleteStamp = jest.fn().mockResolvedValue(undefined); - -// const mockCeramicContext: CeramicContextState = makeTestCeramicContext({ -// handleDeleteStamp: mockHandleDeleteStamp, -// }); - -// mockCeramicContext.allProvidersState.Facebook = { -// providerSpec: STAMP_PROVIDERS.Facebook, -// stamp: { -// provider: "Facebook", -// streamId: "STREAM-ID", -// credential: { -// type: ["VerifiableCredential"], -// proof: { -// jws: "this is the jws", -// type: "Ed25519Signature2018", -// created: "2022-07-01T11:02:03.186Z", -// proofPurpose: "assertionMethod", -// verificationMethod: "did:key:klsdhcu263789gd870237gd8ewg7823#,dsjnbjklhy923769-dhskjcjsdky8973", -// }, -// issuer: "did:key:cdsmlkanfosiu892738921374923ure", -// "@context": ["https://www.w3.org/2018/credentials/v1"], -// issuanceDate: "2022-07-21T11:02:03.185Z", -// expirationDate: "2022-10-19T11:02:03.185Z", -// credentialSubject: { -// id: "did:pkh:eip155:1:0xojicsd86238hdsiy89q7e", -// hash: "v0.0.0:cdsdnkowu827380dsfhfoushfousd", -// "@context": [{ hash: "https://schema.org/Text", provider: "https://schema.org/Text" }], -// provider: "Facebook", -// }, -// }, -// }, -// }; - -// renderWithContext(mockUserContext, mockCeramicContext, ); - -// // Open menu (click the menu button) -// const menuButton = screen.queryByTestId("card-menu-button"); -// fireEvent.click(menuButton!); - -// // Click the delete option -// const deleteMenuOption = screen.queryByTestId("remove-stamp"); -// fireEvent.click(deleteMenuOption!); - -// expect(mockHandleDeleteStamp).toBeCalledWith("STREAM-ID"); -// }); -// }); diff --git a/app/__tests__/context/ceramicContext.test.tsx b/app/__tests__/context/ceramicContext.test.tsx index e5711ce0d8..79633ed588 100644 --- a/app/__tests__/context/ceramicContext.test.tsx +++ b/app/__tests__/context/ceramicContext.test.tsx @@ -11,7 +11,6 @@ import { googleStampFixture, discordStampFixture, brightidStampFixture, - facebookStampFixture, } from "../../__test-fixtures__/databaseStorageFixtures"; import { Passport } from "@gitcoin/passport-types"; import { @@ -59,7 +58,7 @@ export const dbDeleteStampMock = jest.fn(); export const dbDeleteStampsMock = jest.fn(); export const dbCreatePassportMock = jest.fn(); -const stamps = [googleStampFixture, discordStampFixture, brightidStampFixture, facebookStampFixture].map((stamp) => { +const stamps = [googleStampFixture, discordStampFixture, brightidStampFixture].map((stamp) => { stamp.credential.expirationDate = "2099-05-15T21:04:01.708Z"; stamp.credential.credentialSubject.id = "test-user-did"; stamp.credential.issuer = process.env.NEXT_PUBLIC_PASSPORT_IAM_ISSUER_DID || ""; @@ -145,12 +144,12 @@ describe("CeramicContextProvider syncs stamp state with ceramic", () => { }); render(mockComponent()); - await waitFor(() => expect(screen.getAllByText("# Stamps = 4")).toHaveLength(1)); + await waitFor(() => expect(screen.getAllByText("# Stamps = 3")).toHaveLength(1)); }); it("should clean a dirty passport after successful fetch", async () => { const expiredStamp = { - ...facebookStampFixture, - credential: { ...facebookStampFixture.credential, expirationDate: "2021-05-15T21:04:01.708Z" }, + ...googleStampFixture, + credential: { ...googleStampFixture.credential, expirationDate: "2021-05-15T21:04:01.708Z" }, }; (PassportDatabase as jest.Mock).mockImplementation(() => { return { @@ -168,7 +167,7 @@ describe("CeramicContextProvider syncs stamp state with ceramic", () => { }); render(mockComponent()); - await waitFor(() => expect(screen.getAllByText("# Stamps = 4")).toHaveLength(1)); + await waitFor(() => expect(screen.getAllByText("# Stamps = 3")).toHaveLength(1)); }); it("should set passport to undefined if an exception is raised while fetching", async () => { (PassportDatabase as jest.Mock).mockImplementationOnce(() => { @@ -227,7 +226,7 @@ describe("CeramicContextProvider syncs stamp state with ceramic", () => { }); render(mockComponent()); - await waitFor(() => expect(screen.getAllByText("# Stamps = 4")).toHaveLength(1)); + await waitFor(() => expect(screen.getAllByText("# Stamps = 3")).toHaveLength(1)); }); it("should attempt to add stamps to database and ceramic", async () => { @@ -454,7 +453,7 @@ const mockDatabase = { } as PassportDatabase; const mockProvidersState = { google: true, - facebook: true, + ens: true, } as AllProvidersState; describe("cleanPassport function", () => { @@ -477,7 +476,7 @@ describe("cleanPassport function", () => { const validStamp = { credential: { expirationDate: "2099-05-15T21:04:01.708Z", - credentialSubject: { provider: "facebook", id: "test-user-did" }, + credentialSubject: { provider: "google", id: "test-user-did" }, issuer: process.env.NEXT_PUBLIC_PASSPORT_IAM_ISSUER_DID || "", }, }; diff --git a/app/config/filters.ts b/app/config/filters.ts index 68a2b4c753..5a1443f5e5 100644 --- a/app/config/filters.ts +++ b/app/config/filters.ts @@ -13,7 +13,6 @@ export const STAMP_FILTERS: { Ens: ["Account Name"], Poh: ["Account Name"], Twitter: ["Account Name"], - Facebook: ["Account Name"], Brightid: ["Account Name"], Linkedin: ["Account Name"], Discord: ["Account Name"], diff --git a/app/context/ceramicContext.tsx b/app/context/ceramicContext.tsx index b27973a5dd..14c4e6b298 100644 --- a/app/context/ceramicContext.tsx +++ b/app/context/ceramicContext.tsx @@ -23,7 +23,6 @@ const { Lens, Github, Gitcoin, - Facebook, Poh, PHI, NFT, @@ -89,11 +88,6 @@ platforms.set("NFT", { platFormGroupSpec: NFT.ProviderConfig, }); -platforms.set("Facebook", { - platform: new Facebook.FacebookPlatform(), - platFormGroupSpec: Facebook.ProviderConfig, -}); - platforms.set("Github", { platform: new Github.GithubPlatform({ clientId: process.env.NEXT_PUBLIC_PASSPORT_GITHUB_CLIENT_ID, diff --git a/app/pages/_app.tsx b/app/pages/_app.tsx index 286f8b3eee..e57b6c0bf1 100644 --- a/app/pages/_app.tsx +++ b/app/pages/_app.tsx @@ -23,7 +23,6 @@ import TagManager from "react-gtm-module"; import { themes, ThemeWrapper } from "../utils/theme"; import { StampClaimingContextProvider } from "../context/stampClaimingContext"; -const FacebookAppId = process.env.NEXT_PUBLIC_PASSPORT_FACEBOOK_APP_ID || ""; const GTM_ID = process.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID || ""; const INTERCOM_APP_ID = process.env.NEXT_PUBLIC_INTERCOM_APP_ID || ""; @@ -137,39 +136,11 @@ function App({ Component, pageProps }: AppProps) { } } - const facebookSdkScript = ( -