Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…kick into fix-256-vote-reports-handle-shutter-edge-cases
  • Loading branch information
ChaituVR committed Apr 15, 2024
2 parents bb82add + 710d1e6 commit b1a1666
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion test/e2e/nftClaimer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('nftClaimer', () => {
describe('GET /api/nft-claimer', () => {
jest.retryTimes(3);

it('returns an object with the snapshotFee', async () => {
it.skip('returns an object with the snapshotFee', async () => {
const response = await request(HOST).get('/api/nft-claimer');
const fee = response.body.snapshotFee;

Expand Down
14 changes: 7 additions & 7 deletions test/unit/lib/nftClaimer/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('nftClaimer', () => {
}

describe('when deployable', () => {
it('generates the same signature as the smart contract from the data', async () => {
it.skip('generates the same signature as the smart contract from the data', async () => {
mockValidateDeployInput.mockReturnValueOnce(input);

const { signature } = await getPayload();
Expand All @@ -80,7 +80,7 @@ describe('nftClaimer', () => {
expect(signature.v).toEqual(expectedScSignature.v);
});

it('generates the same initializer as the smart contract from the data', async () => {
it.skip('generates the same initializer as the smart contract from the data', async () => {
mockValidateDeployInput.mockReturnValueOnce(input);

const { initializer } = await getPayload();
Expand All @@ -90,7 +90,7 @@ describe('nftClaimer', () => {
expect(initializer).toEqual(expectedInitializer);
});

it('can recover the signer from the digest', async () => {
it.skip('can recover the signer from the digest', async () => {
mockValidateDeployInput.mockReturnValueOnce(input);

const recoveredSigner = recoverAddress(expectedDigest, {
Expand All @@ -104,7 +104,7 @@ describe('nftClaimer', () => {
});

describe('when the space validation failed', () => {
it('throws an error', () => {
it.skip('throws an error', () => {
mockValidateSpace.mockImplementation(() => {
throw new Error();
});
Expand All @@ -114,11 +114,11 @@ describe('nftClaimer', () => {
});

describe('when passing invalid values', () => {
it('throws an error when the spaceOwer address is not valid', () => {
it.skip('throws an error when the spaceOwer address is not valid', () => {
expect(async () => await getPayload({ spaceOwner: 'test' })).rejects.toThrow();
});

it('throws an error when the spaceTreasury address is not valid', () => {
it.skip('throws an error when the spaceTreasury address is not valid', () => {
expect(async () => await getPayload({ spaceTreasury: 'test' })).rejects.toThrow();
});

Expand All @@ -138,7 +138,7 @@ describe('nftClaimer', () => {
expect(async () => await getPayload({ proposerFee: val as any })).rejects.toThrow();
});

it('throws an error when the proposerFee is out of range', () => {
it.skip('throws an error when the proposerFee is out of range', () => {
expect(async () => await getPayload({ proposerFee: '101' })).rejects.toThrow();
expect(async () => await getPayload({ proposerFee: '-5' })).rejects.toThrow();
});
Expand Down
18 changes: 9 additions & 9 deletions test/unit/lib/nftClaimer/mint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('nftClaimer', () => {
}

describe('when mintable', () => {
it('generates the same signature as the smart contract from the data', async () => {
it.skip('generates the same signature as the smart contract from the data', async () => {
const { signature } = await getPayload();

expect(mockFetchProposal).toHaveBeenCalledWith(hexProposalId);
Expand All @@ -93,7 +93,7 @@ describe('nftClaimer', () => {
expect(signature.v).toEqual(expectedScSignature.v);
});

it('can recover the signer from the digest', async () => {
it.skip('can recover the signer from the digest', async () => {
const recoveredSigner = recoverAddress(expectedDigest, {
r: expectedScSignature.r,
s: expectedScSignature.s,
Expand All @@ -105,7 +105,7 @@ describe('nftClaimer', () => {
});

describe('when spaceCollection is not found', () => {
it('throws a SpaceCollection not found error', async () => {
it.skip('throws a SpaceCollection not found error', async () => {
mockGetProposalContract.mockImplementationOnce(() => {
throw new Error();
});
Expand All @@ -114,21 +114,21 @@ describe('nftClaimer', () => {
});

describe('when space has closed minting', () => {
it('throws an error', () => {
it.skip('throws an error', () => {
mockMintingAllowed.mockReturnValueOnce(false);
return expect(async () => await payload(input)).rejects.toThrow();
});
});

describe('when address has not voted on the proposal', () => {
it('throws an error', () => {
it.skip('throws an error', () => {
mockHasVoted.mockReturnValueOnce(false);
return expect(async () => await payload(input)).rejects.toThrow();
});
});

describe('when address has already minted', () => {
it('throws an error', () => {
it.skip('throws an error', () => {
mockHasMinted.mockReturnValueOnce(true);
return expect(async () => await payload(input)).rejects.toThrow();
});
Expand All @@ -139,11 +139,11 @@ describe('nftClaimer', () => {
});

describe('when passing invalid values', () => {
it('throws an error when the proposalAuthor address is not valid', () => {
it.skip('throws an error when the proposalAuthor address is not valid', () => {
expect(async () => getPayload({ proposalAuthor: 'test' })).rejects.toThrow();
});

it('throws an error when the recipient address is not valid', () => {
it.skip('throws an error when the recipient address is not valid', () => {
expect(
async () =>
await getPayload({
Expand All @@ -161,7 +161,7 @@ describe('nftClaimer', () => {
).rejects.toThrow();
});

it('throws an error when the proposal is not found', () => {
it.skip('throws an error when the proposal is not found', () => {
mockFetchProposal.mockReturnValueOnce(null);
return expect(getPayload()).rejects.toThrow();
});
Expand Down
10 changes: 5 additions & 5 deletions test/unit/lib/nftClaimer/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import {

describe('NFTClaimer/utils', () => {
describe('validateAddresses()', () => {
it('returns true when all addresses are valid', () => {
it.skip('returns true when all addresses are valid', () => {
expect(
validateAddresses({
contractA: '0x054a600d8B766c786270E25872236507D8459D8F',
contractB: '0x33505720a7921d23E6b02EB69623Ed6A008Ca511'
})
).toBe(true);
});
it('throws an error when some of the addresses are invalid', () => {
it.skip('throws an error when some of the addresses are invalid', () => {
expect(() => {
validateAddresses({
contractA: '0x054a600d8B766c786270E25872236507D8459D8F',
Expand All @@ -25,23 +25,23 @@ describe('NFTClaimer/utils', () => {
});

describe('validateProposerFee()', () => {
it('throws an error when proposerFee + snapshotFee > 100', () => {
it.skip('throws an error when proposerFee + snapshotFee > 100', () => {
return expect(async () => {
await validateProposerFee(100);
}).rejects.toThrow();
});
});

describe('validateProposal()', () => {
it('throws an error when the proposalAuthor is not matching', () => {
it.skip('throws an error when the proposalAuthor is not matching', () => {
const address = '0x054a600d8B766c786270E25872236507D8459D8F';

expect(async () => {
validateProposal({ author: address } as any, '');
}).rejects.toThrow();
});

it('throws an error when the proposal does not exist', () => {
it.skip('throws an error when the proposal does not exist', () => {
expect(async () => {
validateProposal(null, '');
}).rejects.toThrowError('RECORD_NOT_FOUND');
Expand Down

0 comments on commit b1a1666

Please sign in to comment.