@@ -161,12 +161,23 @@ describe('R2 over objects built by ObjectSchema.create()', () => {
161161 fields : { order : field } ,
162162 } ) ;
163163
164+ // [#25092] The builder no longer lets these two through: the parse it ends in
165+ // refuses a one master marked `readonly` / `system` (spec shape
166+ // `master-not-writable`). This rule still reports the same field on the
167+ // object as the builder would have emitted it (`required` forced to `true`),
168+ // which is what `os lint` reads from a stack that never went through it.
164169 it . each ( [
165170 [ 'readonly' , { readonly : true } ] ,
166171 [ 'system' , { system : true } ] ,
167- ] ) ( 'a %s master reference passes the builder (forced required) and is refused here' , ( flag , extra ) => {
168- const detail = build ( { ...Field . masterDetail ( 'work_order' , { label : 'Work Order' } ) , ...extra } ) ;
169- const issues = r2 ( [ { name : 'work_order' , sharingModel : 'private' , fields : { } } , detail ] ) ;
172+ ] ) ( 'a %s master reference is refused by the builder itself, and reported here on the literal' , ( flag , extra ) => {
173+ const field = { ...Field . masterDetail ( 'work_order' , { label : 'Work Order' } ) , ...extra } ;
174+ expect ( ( ) => build ( field ) ) . toThrow ( / w i t h i t s o n e r e q u i r e d ` m a s t e r _ d e t a i l ` , ` o r d e r ` , m a r k e d / ) ;
175+ const literal = {
176+ name : 'work_order_item' ,
177+ sharingModel : 'controlled_by_parent' ,
178+ fields : { order : { ...field , required : true } } ,
179+ } ;
180+ const issues = r2 ( [ { name : 'work_order' , sharingModel : 'private' , fields : { } } , literal ] ) ;
170181 expect ( issues ) . toHaveLength ( 1 ) ;
171182 expect ( issues [ 0 ] ) . toMatchObject ( { severity : 'error' , path : `objects[1].fields.order.${ flag } ` } ) ;
172183 } ) ;
0 commit comments