2022-03-29 00:20:10 +02:00
|
|
|
import { describe } from "mocha"
|
|
|
|
import SpecialVisualizations from "../../UI/SpecialVisualizations"
|
|
|
|
import { expect } from "chai"
|
|
|
|
|
|
|
|
describe("SpecialVisualisations", () => {
|
|
|
|
describe("predifined special visualisations", () => {
|
|
|
|
it("should not have an argument called 'type'", () => {
|
|
|
|
const specials = SpecialVisualizations.specialVisualizations
|
|
|
|
for (const special of specials) {
|
|
|
|
expect(special.funcName).not.eq(
|
|
|
|
"type",
|
|
|
|
"A special visualisation is not allowed to be named 'type', as this will conflict with the 'special'-blocks"
|
|
|
|
)
|
2022-10-28 04:33:05 +02:00
|
|
|
|
2022-11-02 14:44:06 +01:00
|
|
|
if (special.args === undefined) {
|
|
|
|
throw (
|
|
|
|
"The field 'args' is undefined for special visualisation " +
|
|
|
|
special.funcName
|
|
|
|
)
|
2022-03-29 00:20:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for (const arg of special.args) {
|
|
|
|
expect(arg.name).not.eq(
|
|
|
|
"type",
|
|
|
|
"An argument is not allowed to be called 'type', as this will conflict with the 'special'-blocks"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|