1
0
Fork 0

Merge branch 'develop' of github.com:freesewing/freesewing into develop

This commit is contained in:
Joost De Cock 2022-02-05 08:43:36 +01:00
commit a88a5c453c
5 changed files with 46 additions and 13 deletions

View file

@ -155,15 +155,29 @@ it("Design constructor should handle Simon", () => {
hide: ["base", "frontBase", "front", "backBase", "sleeveBase"]
});
let pattern = new design();
//expect(pattern.config.draftOrder[0]).to.equal("step3");
//expect(pattern.config.draftOrder[1]).to.equal("step4");
//expect(pattern.config.draftOrder[2]).to.equal("step5");
//expect(pattern.config.draftOrder[3]).to.equal("step6");
//expect(pattern.config.draftOrder[4]).to.equal("step7");
//expect(pattern.config.draftOrder[5]).to.equal("step8");
//expect(pattern.config.draftOrder[6]).to.equal("step9");
//expect(pattern.config.draftOrder[7]).to.equal("step10");
//expect(pattern.config.draftOrder[8]).to.equal("step11");
//expect(pattern.config.draftOrder[9]).to.equal("step1");
//expect(pattern.config.draftOrder[10]).to.equal("step2");
});
it("Design constructor should add default hide() method to options", () => {
const design = new freesewing.Design({
foo: "bar",
options: {
constant: 2,
percentage: { pct: 30, min: 0, max: 100 },
degree: { deg: 5, min: 0, max: 10 },
withHide: {
dflt: 'foo',
list: ['foo', 'bar'],
hide: ({ options }) => (options.degree < 6)
}
}
})
const pattern = new design();
expect(typeof pattern.config.options.constant === 'number').to.be.true
expect(typeof pattern.config.options.percentage === 'object').to.be.true
expect(typeof pattern.config.options.degree === 'object').to.be.true
expect(typeof pattern.config.options.withHide === 'object').to.be.true
expect(pattern.config.options.percentage.hide()).to.be.false
expect(pattern.config.options.degree.hide()).to.be.false
expect(pattern.config.options.withHide.hide(pattern.settings)).to.be.true
})