How to use the rosie.Factory.attributes function in rosie

To help you get started, we’ve selected a few rosie 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 astroband / astrograph / tests / factories / account_values.ts View on Github external
data(): IAccountFlags {
    return Factory.attributes("account_values", {});
  }
};
github onap / sdc / openecomp-ui / test-utils / factories / licenseModel / LicenseModelFactories.js View on Github external
.extend('LicenseModelBaseFactory')
	.extend(IdMixin);


export const FinalizedLicenseModelFactory = new Factory()
	.extend(IdMixin)
	.attrs({
		name: randomstring.generate(),
		description: randomstring.generate()
	});

export const LicenseModelOverviewFactory = new Factory()
.attrs({
	licenseModelEditor: {
		data: {
			...Factory.attributes('LicenseModelBaseFactory'),
			id: () => Math.floor(Math.random() * 1000 + 1),
			version: {
				id: Math.floor(Math.random() * 1000 + 1)
			}
		}
	},
	entitlementPool: {},
	licenseAgreement: {},
	featureGroup: {},
	licenseKeyGroup: {},
	licenseModelOverview: {
		descriptionEditor : { data : { description : undefined}},
		selectedTab: selectedButton.VLM_LIST_VIEW
	}
});
github astroband / astrograph / tests / factories / account_values.ts View on Github external
build(overrides?: any): AccountValues {
    const data = Factory.attributes("account_values", overrides);
    data.signers = (overrides && overrides.signers) || [];

    return new AccountValues(data);
  },
  data(): IAccountFlags {
github astroband / astrograph / tests / factories / signer.ts View on Github external
build(overrides?: object): Signer {
    const data = Factory.attributes("signer", overrides);
    return new Signer(data);
  }
};
github astroband / astrograph / tests / factories / transaction.ts View on Github external
build: function(overrides?: object): Transaction {
    const data = Factory.attributes("transaction", overrides);
    return new Transaction(data);
  },
};
github astroband / astrograph / tests / factories / account.ts View on Github external
build(overrides?: object): Account {
    const data = Factory.attributes("account", overrides);
    const account = new Account();
    return Object.assign(account, data);
  }
};

rosie

factory for building JavaScript objects, mostly useful for setting up test data. Inspired by factory_girl

MIT
Latest version published 1 year ago

Package Health Score

71 / 100
Full package analysis