OntoUML / ontouml-js

Javascript library for manipulating OntoUML models.
Apache License 2.0
11 stars 8 forks source link

relover antipattern, first test failure #77

Closed Matt-81 closed 3 years ago

Matt-81 commented 3 years ago

We have generated the first test to identify an occurrence of RelOver anti-pattern (variation 1, from DKE2015, where the targets of mediation relations are overlapping, i.e., share a common parent class).

With the current setting the result of the test is as follows:

With the following output:

  1. RelOver Test › should find the RelOver occurrence
    expect(received).toHaveLength(expected)

    Expected length: 1
    Received length: 0
    Received array:  []

      28 | 
      29 |   it('should find the RelOver occurrence', () => {
    > 30 |     expect(output.result).toHaveLength(1);
         |                           ^
      31 |   });
      32 | 
      33 |   it('should set «relator» Supervision in the RelOver occurrence', () => {

      at Object.<anonymous> (__tests__/libs/antipattern/general.test.ts:30:27)
  1. RelOver Test › should set «relator» Supervision in the RelOver occurrence:
    TypeError: Cannot read property 'relator' of undefined

      33 |   it('should set «relator» Supervision in the RelOver occurrence', () => {
      34 |     const relover: RelOverOccurrence = output.result[0]; //this means that the output is an array
    > 35 |     expect(relover.relator).toEqual(supervision);
         |                    ^
      36 |   });
      37 | });
      38 | 

I would need help to precisely understand the error (actually, thanks to @claudenirmf we discovered what causes the issue and I commented on the related code lines, see test file). However, I am still trying to precisely figure out the issue, thus being able to address it.

Thanks in advance for your help :)