text: // Generated by CoffeeScript 2.6.0
  (function() {
    //#####################################################################
    // Word of the Day SC Unit Test
    // -----
    // Copyright (c) Kiruse 2021. Licensed under MIT License
    var Queue, WotD, assert, passes, reverts;
  
    assert = require('chai').assert;
  
    ({passes, reverts} = require('truffle-assertions'));
  
    WotD = artifacts.require('WotD');
  
    Queue = artifacts.require('Queue');
  
    contract('WotD', function(accs) {
      it('should require ownership', async function() {
        var reason, wotd;
        reason = 'ownership required';
        wotd = (await WotD.deployed());
        await reverts(wotd.transferOwnership(accs[1], {
          from: accs[1]
        }), reason);
        await reverts(wotd.enqueueWotD('test', {
          from: accs[1]
        }), reason);
        return (await reverts(wotd.forceUpdateWotD({
          from: accs[1]
        }), reason));
      });
      it('should add wotd', async function() {
        var queue, wotd;
        wotd = (await WotD.deployed());
        queue = (await Queue.at((await wotd.queue())));
        await wotd.enqueueWotD('Soliloquy');
        assert.strictEqual(((await wotd.count())).toNumber(), 1);
        assert.strictEqual(((await queue.size())).toNumber(), 1);
        await wotd.enqueueWotD('solipsistic');
        assert.strictEqual(((await wotd.count())).toNumber(), 2);
        return assert.strictEqual(((await queue.size())).toNumber(), 2);
      });
      it('should update WotD', async function() {
        var queue, wotd;
        wotd = (await WotD.deployed());
        queue = (await Queue.at((await wotd.queue())));
        assert.strictEqual((await wotd.wotd()), '');
        await passes(wotd.updateWotD({
          from: accs[1]
        }));
        assert.strictEqual((await wotd.wotd()), 'Soliloquy');
        assert.strictEqual(((await wotd.count())).toNumber(), 2);
        await reverts(wotd.updateWotD({
          from: accs[0]
        }), 'too soon');
        await passes(wotd.forceUpdateWotD({
          from: accs[0]
        }));
        assert.strictEqual((await wotd.wotd()), 'solipsistic');
        return assert.strictEqual(((await wotd.count())).toNumber(), 2);
      });
      it('should find words', async function() {
        var wotd;
        wotd = (await WotD.deployed());
        assert.strictEqual(((await wotd.findWord('Soliloquy'))).toNumber(), 0);
        return assert.strictEqual(((await wotd.findWord('solipsistic'))).toNumber(), 1);
      });
      return it('should remove words', async function() {
        var wotd;
        wotd = (await WotD.deployed());
        await passes(wotd.removeWord(0, 'Soliloquy'));
        assert.strictEqual(((await wotd.count())).toNumber(), 1);
        assert.strictEqual(((await wotd.findWord('solipsistic'))).toNumber(), 0);
        await reverts(wotd.findWord('Soliloquy'), 'not found');
        await passes(wotd.removeWord(0, 'solipsistic'));
        assert.strictEqual(((await wotd.count())).toNumber(), 0);
        return (await reverts(wotd.findWord('solipsistic'), 'not found'));
      });
    });
  
  }).call(this);
  