});
});

/*
 * not supported yet
 */
test.skip('Fetching records collection: supports fetching relationships', function (t) {
  t.plan(2);

  sails.request({
    url   : '/author/1/relationships/books',
    method: 'GET'
  }, function (err, res, body) {
    if (err) {
      t.fail(err);
    }
    try {
      t.equal(res.statusCode, 200, 'HTTP status code is 200');
      t.equal(res.headers['Content-Type'], 'application/vnd.api+json', 'Sends jsonapi mime type');
      t.ok(validateJsonApi(body), 'Body is a valid JSON API');
    } catch (err) {
      t.fail(err);
    }
    t.end();
  });
});

/*
 * JSON API is agnostic about the strategies supported by a server.
 * The filter query parameter can be used as the basis for any number of filtering strategies.
 * Assuming waterline criteria object.
 */
Beispiel #2
0
test.skip('Piping through a default transform stream causes backpressure to be exerted after some delay', t => {
  t.plan(2);

  // Producer: every 20 ms
  const enqueueReturnValues = [];
  const rs = new ReadableStream({
    start(c) {
      setTimeout(() => enqueueReturnValues.push(c.enqueue('a')), 10);
      setTimeout(() => enqueueReturnValues.push(c.enqueue('b')), 30);
      setTimeout(() => enqueueReturnValues.push(c.enqueue('c')), 50);
      setTimeout(() => enqueueReturnValues.push(c.enqueue('d')), 70);
      setTimeout(() => enqueueReturnValues.push(c.enqueue('e')), 90);
      setTimeout(() => enqueueReturnValues.push(c.enqueue('f')), 110);
      setTimeout(() => enqueueReturnValues.push(c.enqueue('g')), 130);
      setTimeout(() => enqueueReturnValues.push(c.enqueue('h')), 150);
      setTimeout(() => c.close(), 170);
    }
  });

  const ts = new TransformStream({
    transform(chunk, enqueue, done) {
      enqueue(chunk);
      done();
    }
  });

  // Consumer: every 90 ms
  const writtenValues = [];
  const ws = new WritableStream({
    write(chunk) {
      return new Promise(resolve => {
        setTimeout(() => {
          writtenValues.push(chunk);
          resolve();
        }, 90);
      });
    }
  });

  setTimeout(() => {
    rs.pipeThrough(ts).pipeTo(ws).then(() => {
      t.deepEqual(
        enqueueReturnValues,
        [true, true, true, true, false, false, false, false],
        'backpressure was correctly exerted at the source');
      t.deepEqual(writtenValues, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], 'all chunks were written');
    });
  }, 0);
});
/*eslint-disable */
import test from 'tape-catch';
import React from 'react';

import shallow from '../../testUtils/shallow';
import ButtonDropdown from './index.js';

// Container component
test.skip('<ButtonDropdown />', t => {

  const { instance, result } = shallow(<ButtonDropdown />);
  t.ok(instance);
  t.ok(result);
  t.end();
});