How to use the uniforms/createSchemaBridge function in uniforms

To help you get started, we’ve selected a few uniforms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vazco / uniforms / packages / uniforms / __tests__ / createSchemaBridge.ts View on Github external
it('recognizes a registered bridge', () => {
    class TestSchema {}
    class TestSchemaBridge extends Bridge {
      static check(schema: any) {
        return schema instanceof TestSchema;
      }
    }

    createSchemaBridge.register(TestSchemaBridge);

    expect(createSchemaBridge(new TestSchema())).toBeInstanceOf(
      TestSchemaBridge
    );
  });
github vazco / uniforms / packages / uniforms / __tests__ / createSchemaBridge.ts View on Github external
it('accepts a Bridge instance', () => {
    const bridge = {
      getError() {},
      getErrorMessage() {},
      getErrorMessages() {},
      getField() {},
      getInitialValue() {},
      getProps() {},
      getSubfields() {},
      getType() {},
      getValidator() {}
    };

    expect(createSchemaBridge(bridge)).toBe(bridge);
  });
github focallocal / fl-maps / tests / unit-tests / helpers / uniformsSchema.js View on Github external
const createSchema = schema => createSchemaBridge(new SimpleSchema(schema))