Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
chore(tests): fix record test
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Nov 30, 2023
1 parent 5382946 commit 130f01c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/integration/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,17 +440,21 @@ describe('Integration tests', () => {
expect(owner).to.be.undefined;
});

it(`should return the correct state value for record up to a given block height`, async () => {
it(`should return the correct state value for record up to a given sort key`, async () => {
const knownSortKey = contractInteractions[0].sortKey;
const { status, data } = await axios.get(
`/v1/contract/${id}/records/example?sortKey=${knownSortKey}`,
);
expect(status).to.equal(200);
expect(data).to.not.be.undefined;
const { contractTxId, sortKey } = data;
const { contractTxId, sortKey, record, owner } = data;
expect(contractTxId).to.equal(id);
expect(sortKey).to.equal(knownSortKey);
expect(Object.keys(data['records'])).to.have.length(2);
expect(record).to.deep.equal({
contractTxId: process.env.DEPLOYED_ANT_CONTRACT_TX_ID,
});
expect(sortKey).not.be.undefined;
expect(owner).to.not.be.undefined;
expect(owner).to.equal(walletAddress);
});

it('should return a 404 when the record name does not exist', async () => {
Expand Down

0 comments on commit 130f01c

Please sign in to comment.