We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d22839c commit ed8767dCopy full SHA for ed8767d
e2e/index.e2e.ts
@@ -528,6 +528,25 @@ describe('defineTypeFactory', () => {
528
height: number;
529
}>();
530
});
531
+ it('increments seq even with traits', async () => {
532
+ const ImageFactory = defineImageFactory({
533
+ defaultFields: {
534
+ id: dynamic(({ seq }) => `Image-${seq}`),
535
+ url: '#',
536
+ },
537
+ traits: {
538
+ avatar: {
539
540
+ url: 'https://example.com/avatar.png',
541
542
543
544
+ });
545
+ const image1 = await ImageFactory.build();
546
+ const image2 = await ImageFactory.use('avatar').build();
547
+ expect(image1.id).toBe('Image-0');
548
+ expect(image2.id).toBe('Image-1');
549
550
551
describe('transientFields', () => {
552
it('basic', async () => {
0 commit comments