Skip to content

Commit

Permalink
feat: ID-2334 Removed preload call from Magic SDK (#2146)
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenfowler authored Sep 6, 2024
1 parent 4b80048 commit 96824ab
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/passport/sdk/src/Passport.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ describe('Passport', () => {
(Magic as jest.Mock).mockImplementation(() => ({
openid: { loginWithOIDC: mockLoginWithOidc },
rpcProvider: { request: mockMagicRequest },
preload: jest.fn(),
}));
});

Expand Down
6 changes: 0 additions & 6 deletions packages/passport/sdk/src/magicAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('MagicWallet', () => {
magicProviderId: providerId,
} as PassportConfiguration;
const idToken = 'e30=.e30=.e30=';
const preload = jest.fn();

beforeEach(() => {
jest.resetAllMocks();
Expand All @@ -35,7 +34,6 @@ describe('MagicWallet', () => {
logout: logoutMock,
},
rpcProvider,
preload,
}));
});

Expand All @@ -56,7 +54,6 @@ describe('MagicWallet', () => {
});
it('starts initialising the magicClient', () => {
jest.spyOn(window.document, 'readyState', 'get').mockReturnValue('complete');
preload.mockResolvedValue(Promise.resolve());
const magicAdapter = new MagicAdapter(config);
// @ts-ignore
expect(magicAdapter.lazyMagicClient).toBeDefined();
Expand All @@ -83,7 +80,6 @@ describe('MagicWallet', () => {

describe('login', () => {
it('should call loginWithOIDC and initialise the provider with the correct arguments', async () => {
preload.mockResolvedValue(Promise.resolve());
const magicAdapter = new MagicAdapter(config);
const magicProvider = await magicAdapter.login(idToken);

Expand All @@ -101,7 +97,6 @@ describe('MagicWallet', () => {
});

it('should throw a PassportError when an error is thrown', async () => {
preload.mockResolvedValue(Promise.resolve());
const magicAdapter = new MagicAdapter(config);

loginWithOIDCMock.mockImplementation(() => {
Expand All @@ -121,7 +116,6 @@ describe('MagicWallet', () => {

describe('logout', () => {
it('calls the logout function', async () => {
preload.mockResolvedValue(Promise.resolve());
const magicAdapter = new MagicAdapter(config);
await magicAdapter.login(idToken);
await magicAdapter.logout();
Expand Down
1 change: 0 additions & 1 deletion packages/passport/sdk/src/magicAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default class MagicAdapter {
extensions: [new OpenIdExtension()],
network: MAINNET, // We always connect to mainnet to ensure addresses are the same across envs
});
client.preload();
return client;
});
}
Expand Down

0 comments on commit 96824ab

Please sign in to comment.