// FIXME skipping as this is behaving erratically (and it's not a fundamental function) describe('Categories method', () => { it('should fetch valid list of categories', () => { return gplay.categories().then(categories => { assert.isArray(categories); assert.isTrue(categories.length > 0); }); }); it('should have all categories from constant list of categories', () => { return gplay.categories().then(categories => { const categoriesConst = Object.keys(gplay.category); assert.deepEqual( R.difference(categories, categoriesConst), [], 'Google Play has categories that are not in "category" constant' ); assert.deepEqual( R.difference(categoriesConst, categories), [], 'There is some categories in the constant that were removed from Play Store' ); }); }); });
app.screenshots.map(assertValidUrl); assert.isArray(app.comments); assert.isAbove(app.comments.length, 0); app.comments.map(assert.isString);
it('path.Out([predicatePath, ...], [tag, ...])', function() { return cayleyClient.g.V('</user/shortid/46Juzcyx>').Out(['<follows>', '<userId>'], ['predicate', 'extraTag']).All().then((res) => { assert.isArray(res.result); }); });
it('query.ToArray(gizmoFunc, callback)', function() { const popularQuery = cayleyClient.g.M().Out('<follows>').In('<follows>').Has('<gender>', 'F').Out(['<email>', '<mobilePhone>']); return cayleyClient.g.V('</user/shortid/46Juzcyx>').Follow(popularQuery).ToArray(function(data) { for (var item in data) { g.Emit(data[item]); } }).then((res) => { assert.isArray(res.result); }); });
test('getting host ips', () => { const hostIPs = utils.getHostIPs(); assert.isArray(hostIPs); hostIPs.forEach((ip) => { assert.isString(ip, 'IPs are given as'); assert.isTrue(ip.indexOf('.') >= 0 || ip.indexOf(':') >= 0, 'IP format'); }); });
describe('HTML to TextObjects', () => { it('parse HTML', (done) => { const textObjects = htmlToTextObjects(htmlCodes); assert.isArray(textObjects); done(); }); });
it('path.Skip(offset), skip 0', function() { return cayleyClient.g.V().Has('<alpha3CountryCode>', 'SGP').Skip(0).All().then((res) => { assert.isArray(res.result); assert.equal(res.result.length, 3); }); });
it('path.In([predicatePath, ...], [tag, ...])', function() { return cayleyClient.g.V('false').In( cayleyClient.g.V(['<isEmailVerified>', '<isVerified>']), ['predicate', 'extraTag'] ).All().then((res) => { assert.isArray(res.result); }); });
it('path.LabelContext(), pass in nothing', function() { return cayleyClient.g.V('</user/shortid/BJg4Kj2HOe>').LabelContext().In('<follows>').All().then((res) => { assert.isArray(res.result); }); });
it('query.ForEach(limit, gizmoFunc, callback)', function() { const popularQuery = cayleyClient.g.M().Out('<follows>').In('<follows>').Has('<gender>', 'F').Out(['<email>', '<mobilePhone>']); return cayleyClient.g.V('</user/shortid/46Juzcyx>').Follow(popularQuery).ForEach(1, function(data) { for (var item in data) { g.Emit(data[item]); } }).then((res) => { assert.isArray(res.result); }); });
it('path.OutPredicates()', function() { return cayleyClient.g.V('</user/shortid/BJg4Kj2HOe>').OutPredicates().All().then((res) => { assert.isArray(res.result); }); });
it('path.Out([predicatePath, ...], [tag, ...])', function() { return cayleyClient.g.V('</user/shortid/46Juzcyx>').Out( cayleyClient.g.V(['<userId>', '<userSetId>']), ['predicate', 'extraTag'] ).All().then((res) => { assert.isArray(res.result); }); });
it('path.Save(predicate, tag)', function() { return cayleyClient.g.V('</user/shortid/BJg4Kj2HOe>').Save('<follows>', 'target').All().then((res) => { assert.isArray(res.result); }); });
it('query.Map(limit, gizmoFunc, callback)', function() { const popularQuery = cayleyClient.g.M().Out('<follows>').In('<follows>').Has('<gender>', 'F').Out(['<email>', '<mobilePhone>']); return cayleyClient.g.V('</user/shortid/46Juzcyx>').Follow(popularQuery).Map(1, function(data) { for (var item in data) { g.Emit(data[item]); } }).then((res) => { assert.isArray(res.result); }); });
it('path.In(predicatePath, tag)', function() { return cayleyClient.g.V('false').In('<isEmailVerified>', 'predicate').All().then((res) => { assert.isArray(res.result); }); });