text: var should = require('should');
  var helper = require('node-red-node-test-helper');
  var node = require('../node.js');
  
  helper.init(require.resolve('node-red'));
  
  describe('thingsboard-rest-api-auth node', function () {
  
      before(function (done) {
          helper.startServer(done);
      });
  
      after(function (done) {
          helper.stopServer(done);
      });
  
      afterEach(function () {
          helper.unload();
      });
  
      it('should be loaded', function (done) {
          var flow = [{ id: 'n1', type: 'thingsboard-rest-api-auth', name: 'thingsboard-rest-api-auth' }];
          helper.load(node, flow, function () {
              var n1 = helper.getNode('n1');
              n1.should.have.property('name', 'thingsboard-rest-api-auth');
              done();
          });
      });
  
      it('should handle loginPost()', function (done) {
          var flow = [
              { id: 'n1', type: 'thingsboard-rest-api-auth', name: 'thingsboard-rest-api-auth',
                  method: 'loginPost',
                  loginPost_body: '<node property>', // (1) define node properties
                  wires: [['n3']]
              },
              { id: 'n3', type: 'helper' }
          ];
          helper.load(node, flow, function () {
              var n3 = helper.getNode('n3');
              var n1 = helper.getNode('n1');
              n3.on('input', function (msg) {
                  try {
                      msg.should.have.property('payload', '<output message>'); // (3) define output message
                      done();
                  } catch (e) {
                      done(e);
                  }
              });
              n1.receive({ payload: '<input message>' }); // (2) define input message
          });
      });
  });
  