ERC20Metadata.test.js 742 B

12345678910111213141516171819202122232425
  1. require('openzeppelin-test-helpers');
  2. const ERC20MetadataMock = artifacts.require('ERC20MetadataMock');
  3. const { expect } = require('chai');
  4. const metadataURI = 'https://example.com';
  5. describe('ERC20Metadata', function () {
  6. beforeEach(async function () {
  7. this.token = await ERC20MetadataMock.new(metadataURI);
  8. });
  9. it('responds with the metadata', async function () {
  10. expect(await this.token.tokenURI()).to.equal(metadataURI);
  11. });
  12. describe('setTokenURI', function () {
  13. it('changes the original URI', async function () {
  14. const newMetadataURI = 'https://betterexample.com';
  15. await this.token.setTokenURI(newMetadataURI);
  16. expect(await this.token.tokenURI()).to.equal(newMetadataURI);
  17. });
  18. });
  19. });