11import { findFirstNode , isInlineBlock } from 'datocms-structured-text-utils' ;
22import { generateNewCmaClient } from '../../../jest-helpers/generateNewCmaClient' ;
33import {
4- type ItemTypeDefinition ,
5- SchemaRepository ,
64 buildBlockRecord ,
7- duplicateBlockRecord ,
5+ duplicateBlockRecord , SchemaRepository , type ItemTypeDefinition
86} from '../src' ;
97
108describe ( 'item (explicit typing with item definitions)' , ( ) => {
@@ -17,7 +15,7 @@ describe('item (explicit typing with item definitions)', () => {
1715 // === Type Definitions ===
1816 type Block = ItemTypeDefinition <
1917 EnvironmentSettings ,
20- string ,
18+ "cr3EA7ueQtaJyV91jyiEyw" ,
2119 {
2220 title : { type : 'string' } ;
2321 rich_text : { type : 'rich_text' ; blocks : Block } ;
@@ -32,6 +30,7 @@ describe('item (explicit typing with item definitions)', () => {
3230
3331 // === Block Model Setup ===
3432 const blockModel = await client . itemTypes . create ( {
33+ id : 'cr3EA7ueQtaJyV91jyiEyw' ,
3534 name : 'Block' ,
3635 api_key : 'block' ,
3736 modular_block : true ,
@@ -141,22 +140,22 @@ describe('item (explicit typing with item definitions)', () => {
141140 rich_text : [
142141 buildBlockRecord < Block > ( {
143142 title : 'Rich Text: Level 2' ,
144- item_type : blockModel ,
143+ item_type : { type : 'item_type' , id : 'cr3EA7ueQtaJyV91jyiEyw' } ,
145144 } ) ,
146145 ] ,
147146 } ,
148147 relationships : {
149- item_type : { data : { id : blockModel . id , type : 'item_type' } } ,
148+ item_type : { data : { id : 'cr3EA7ueQtaJyV91jyiEyw' , type : 'item_type' } } ,
150149 } ,
151150 } ,
152151 ] ,
153152 single_block : buildBlockRecord < Block > ( {
154153 title : 'Single Block: Level 1' ,
155154 single_block : buildBlockRecord < Block > ( {
156155 title : 'Single Block: Level 2' ,
157- item_type : blockModel ,
156+ item_type : { type : 'item_type' , id : 'cr3EA7ueQtaJyV91jyiEyw' } ,
158157 } ) ,
159- item_type : blockModel ,
158+ item_type : { type : 'item_type' , id : 'cr3EA7ueQtaJyV91jyiEyw' } ,
160159 } ) ,
161160 structured_text : {
162161 schema : 'dast' ,
@@ -179,13 +178,13 @@ describe('item (explicit typing with item definitions)', () => {
179178 type : 'block' ,
180179 item : buildBlockRecord < Block > ( {
181180 title : 'Structured Text: Level 2' ,
182- item_type : blockModel ,
181+ item_type : { type : 'item_type' , id : 'cr3EA7ueQtaJyV91jyiEyw' } ,
183182 } ) ,
184183 } ,
185184 ] ,
186185 } ,
187186 } ,
188- item_type : blockModel ,
187+ item_type : { type : 'item_type' , id : 'cr3EA7ueQtaJyV91jyiEyw' } ,
189188 } ) ,
190189 } ,
191190 ] ,
0 commit comments