Skip to content
Snippets Groups Projects

Fix reference resolution in ArchiveBrowser

All threads resolved!
1 file
+ 0
71
Compare changes
  • Side-by-side
  • Inline
@@ -177,74 +177,3 @@ test.each([
await waitFor(() => expect(numberFields[index].value).toEqual(value))
}
})
const mockPackageReferences = () => {
return {
packages: [
{
name: 'testPackage',
section_definitions: [
{
name: 'ReferencingSection',
quantities: [
{
name: 'my_reference',
default: 'my_reference',
type: {
_referencedDefinition: 'ReferencedSection'
},
m_annotations: {
eln: [
{
component: "ReferenceEditQuantity"
}
]
},
m_parent_sub_section: 'quantities'
}
]
},
{
name: 'ReferencedSection',
quantities: [
{
name: 'my_quantity',
type: {
typeKind: 'str'
},
m_annotations: {
eln: [
{
component: "StringEditQuantity"
}
]
},
m_parent_sub_section: 'quantities'
}
]
}
]
}
]
}
}
test.only.each([
['section', '#/data/subsection/0'],
['section with m_def', '#/data/subsection/0']
])('test references: %s', async (name, reference) => {
const metainfo = await createMetainfo(mockPackageReferences())
const def = await metainfo.getDefsByName().ReferencingSection[0]
const adaptor = new TestAdaptor('', 'Data')
render(
<laneContext.Provider value={{next: {}, adaptor: adaptor}}>
<Section
section={{my_reference: reference}}
def={def}
sectionIsInEln={true}
sectionIsEditable={true}
/>
</laneContext.Provider>
)
screen.getByText('Test')
})
Loading