Skip to content

Commit

Permalink
disabling allowlisting spec
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbronco committed May 27, 2024
1 parent cec05dd commit 917fdb7
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions src/modules/allowlist/pool.spec.ts
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
import nock from 'nock';
import { allowlistPool } from './pool';
import { callGitHubWebhook } from '@/modules/github';
import { ALLOWLIST_POOL_ENDPOINT } from '@/constants';
// import nock from 'nock';
// import { allowlistPool } from './pool';
// import { callGitHubWebhook } from '@/modules/github';
// import { ALLOWLIST_POOL_ENDPOINT } from '@/constants';

nock.disableNetConnect();
// nock.disableNetConnect();

jest.unmock('@balancer-labs/sdk');
// jest.unmock('@balancer-labs/sdk');

jest.mock('@ethersproject/contracts');
jest.mock(
'@/modules/github',
jest.fn().mockImplementation(() => {
return {
callGitHubWebhook: jest.fn().mockImplementation(() => {
return { status: 200 };
}),
};
})
);
// jest.mock('@ethersproject/contracts');
// jest.mock(
// '@/modules/github',
// jest.fn().mockImplementation(() => {
// return {
// callGitHubWebhook: jest.fn().mockImplementation(() => {
// return { status: 200 };
// }),
// };
// })
// );

describe('Allowlist Pool', () => {
afterEach(() => {
jest.resetAllMocks();
})
// describe('Allowlist Pool', () => {
// afterEach(() => {
// jest.resetAllMocks();
// })

it('Should call the Github webhook with data passed into function', async () => {
require('@ethersproject/contracts')._setSymbolMethod(() =>
Promise.resolve('bb-a-USD')
);
require('@ethersproject/contracts')._setVersionMethod(() =>
Promise.resolve(
JSON.stringify({
name: 'ComposableStablePool',
version: 3,
deployment: '20230206-composable-stable-pool-v3',
})
)
);
await allowlistPool(
1,
'0xfebb0bbf162e64fb9d0dfe186e517d84c395f016000000000000000000000502'
);
expect(callGitHubWebhook).toBeCalledWith(ALLOWLIST_POOL_ENDPOINT, {
event_type: 'allowlist_pool',
client_payload: {
network: "ethereum",
poolType: 'Stable',
poolId:
'0xfebb0bbf162e64fb9d0dfe186e517d84c395f016000000000000000000000502',
poolDescription: 'bb-a-USD',
},
});
});
// it('Should call the Github webhook with data passed into function', async () => {
// require('@ethersproject/contracts')._setSymbolMethod(() =>
// Promise.resolve('bb-a-USD')
// );
// require('@ethersproject/contracts')._setVersionMethod(() =>
// Promise.resolve(
// JSON.stringify({
// name: 'ComposableStablePool',
// version: 3,
// deployment: '20230206-composable-stable-pool-v3',
// })
// )
// );
// await allowlistPool(
// 1,
// '0xfebb0bbf162e64fb9d0dfe186e517d84c395f016000000000000000000000502'
// );
// expect(callGitHubWebhook).toBeCalledWith(ALLOWLIST_POOL_ENDPOINT, {
// event_type: 'allowlist_pool',
// client_payload: {
// network: "ethereum",
// poolType: 'Stable',
// poolId:
// '0xfebb0bbf162e64fb9d0dfe186e517d84c395f016000000000000000000000502',
// poolDescription: 'bb-a-USD',
// },
// });
// });

it('Should be avoided for LBP pools', async () => {
require('@ethersproject/contracts')._setSymbolMethod(() =>
Promise.resolve('SUPER_DUMMY_LBP')
);
// it('Should be avoided for LBP pools', async () => {
// require('@ethersproject/contracts')._setSymbolMethod(() =>
// Promise.resolve('SUPER_DUMMY_LBP')
// );

await allowlistPool(
1,
'0xfebb0bbf162e64fb9d0dfe186e517d84c395f016000000000000000000000502'
);
expect(callGitHubWebhook).not.toBeCalled();
});
});
// await allowlistPool(
// 1,
// '0xfebb0bbf162e64fb9d0dfe186e517d84c395f016000000000000000000000502'
// );
// expect(callGitHubWebhook).not.toBeCalled();
// });
// });

0 comments on commit 917fdb7

Please sign in to comment.