Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/modules / ___dist / _forks / graphene / test / interface.js
Size: Mime:
"use strict";

var _graphql = require("graphql");

var _src = require("../src");

describe("Interface", () => {
  test(`create Interface`, () => {
    class MyInterface extends _src.Interface {}

    expect(MyInterface.typeName).toBe("MyInterface");
    expect(MyInterface.description).toBe(undefined);
  });
  test(`create Interface custom settings`, () => {
    class MyInterface extends _src.Interface {}

    MyInterface.typeName = "MyInterfaceType";
    MyInterface.description = "MyInterfaceType Description";
    expect(MyInterface.typeName).toBe("MyInterfaceType");
    expect(MyInterface.description).toBe("MyInterfaceType Description");
  });
  test(`create Interface with fields`, () => {
    class MyInterface extends _src.Interface {}

    MyInterface.description = "My Description";
    MyInterface.fields = {
      hello: new _src.Field(_src.String)
    };
    expect(Object.keys(MyInterface.fields)).toEqual(["hello"]);
    const gql = MyInterface.gql;
    expect(gql).toBeInstanceOf(_graphql.GraphQLInterfaceType);
    expect(gql.name).toBe("MyInterface");
    expect(gql.description).toBe("My Description");
    expect(Object.keys(gql.getFields())).toEqual(["hello"]);
  });
});