Skip to main content
Added a more general recommendation
Source Link
Felix van Hove
  • 3.6k
  • 6
  • 24
  • 33

if(this.pageFlattenedData && this.pageFlattenedData.lenght > 0)

This should be length. this.showMessage never gets true.

If I were you, I'd move the methods below @wire to a separate Javascript module. A separate module can be tested much more easily, because unit tests can directly test individual methods. E.g. above problem would almost for sure have come to light writing a unit test for showMessageOrTable().

if(this.pageFlattenedData && this.pageFlattenedData.lenght > 0)

This should be length. this.showMessage never gets true.

if(this.pageFlattenedData && this.pageFlattenedData.lenght > 0)

This should be length. this.showMessage never gets true.

If I were you, I'd move the methods below @wire to a separate Javascript module. A separate module can be tested much more easily, because unit tests can directly test individual methods. E.g. above problem would almost for sure have come to light writing a unit test for showMessageOrTable().

deleted 31 characters in body
Source Link
Felix van Hove
  • 3.6k
  • 6
  • 24
  • 33

if(this.pageFlattenedData && this.pageFlattenedData.lenght > 0)

This should be length. this.showMessage never gets true.

Or is there something else?

if(this.pageFlattenedData && this.pageFlattenedData.lenght > 0)

This should be length. this.showMessage never gets true.

Or is there something else?

if(this.pageFlattenedData && this.pageFlattenedData.lenght > 0)

This should be length. this.showMessage never gets true.

Source Link
Felix van Hove
  • 3.6k
  • 6
  • 24
  • 33

if(this.pageFlattenedData && this.pageFlattenedData.lenght > 0)

This should be length. this.showMessage never gets true.

Or is there something else?