OpenCompare / editor

Javascript editor for product comparison matrices
Apache License 2.0
0 stars 2 forks source link

Externalization of input PCMs for testing #1

Open acherm opened 7 years ago

acherm commented 7 years ago

The goal is to have a testing procedure that loads a PCM and controls that some operations/services are working well.

What is expected is that some PCMs pose some difficulties (e.g., no "product column") and numerous bugs in opencompare are indeed related to JS issues.

I've tried to use Karma and it works pretty well.

I've used openCompareEditorApp (and not openCompareEditor directly) to load a PCM. We can then write some assertions.

What I don't like at the moment is that the PCM is hardcoded within openCompareEditorApp. If we want to change it you have to copy and paster 1000 lines. It's also weird to read.

Ideally the input test PCM should be externalized somewhere (in a local JSON file)

I've made some attempts:

Ideally the openCompareServer service should work with "local" PCM files (without a server)

Some additional notes:

acherm commented 7 years ago

Karma is now working with external JSON files. Commit f2ba7619b443c3b77eaa67b6e477797091be3fd9 Data located in the "test" folder of app. I would like to put it outside "app" but that's not so easy.

Another possible improvement is as follows: grunt serveworks if you uncomment $scope.launchOCEditor(). That's normal but if you uncomment this line, then the testing fails because it first calls $scope.launchOCEditor() with a specific JSON.

Overall I have impression we should develop and maintain another HTML/JS file for "showcase" (serve) and "test"