Skip to content

Commit

Permalink
update testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
luu-alex committed Oct 3, 2023
1 parent 0e9f363 commit bb176eb
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
import Web3 from 'web3';
// eslint-disable-next-line import/no-extraneous-dependencies
import { Web3Account } from 'web3-eth-accounts';
import { EventLog } from 'web3-types';
import { Contract } from '../../../src';
import { ERC721TokenAbi, ERC721TokenBytecode } from '../../shared_fixtures/build/ERC721Token';
import { getSystemTestProvider, createLocalAccount } from '../../fixtures/system_test_utils';
Expand Down Expand Up @@ -80,8 +79,8 @@ describe('contract', () => {
tempAccount.address.toLowerCase(),
);

const logs = await contractDeployed.getPastEvents('Transfer');
const tokenId = (logs[0] as EventLog)?.returnValues?.tokenId as string;

const tokenId = awardReceipt.events?.Transfer.returnValues.tokenId as string;

expect(
toUpperCaseHex(
Expand Down Expand Up @@ -113,8 +112,7 @@ describe('contract', () => {
tempAccount.address.toLowerCase(),
);

const logs = await contractDeployed.getPastEvents('Transfer');
const tokenId = (logs[0] as EventLog)?.returnValues?.tokenId as string;
const tokenId = awardReceipt.events?.Transfer.returnValues.tokenId as string;
const transferFromReceipt = await contractDeployed.methods
.transferFrom(tempAccount.address, toAccount.address, tokenId)
.send({
Expand Down Expand Up @@ -185,9 +183,8 @@ describe('contract', () => {
expect(String(awardReceipt.events?.Transfer.returnValues[1]).toLowerCase()).toBe(
tempAccount.address.toLowerCase(),
);

const logs = await contractDeployed.getPastEvents('Transfer');
const tokenId = (logs[0] as EventLog)?.returnValues?.tokenId as string;

const tokenId = awardReceipt.events?.Transfer.returnValues.tokenId as string;

const approveReceipt = await contractDeployed.methods
.approve(toAccount.address, tokenId)
Expand Down

0 comments on commit bb176eb

Please sign in to comment.