When defining a mock configuration for a given slice, in .slicemachine/mock-config.json file, you can alter the way a mock will be generated. This configuration occurs per field and depends on the widget type the field points to.

Structured Text

When a config object is passed to ST Widget, it merges it with its own default values. These default values are:

To generate interesting mocks, the widget uses a pattern system, where a pattern is defined as an array of text types (eg. ['heading1', 'paragraph']) that will be repeated a defined blocks number of times. This is useful to generate repeating content, like a blog post might be.

When passing a pattern array to the mock configuration, it gets repeated between blocks.min and blocks.max times.

Predefined pattern types:

Instead of specifying your own pattern, you can a special key called patternType with one of these values:

Content:

Instead of passing a config object to the ST widget, you can pass it a content property. It will behave differently depending of what you feed it with:

Examples:

1) Create a RichText of type Heading by using a heading text type found in my config