-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bufix: pass settings to from Radix to AspectCalculator (#71)
* Test to drive bugfix: #71 * Bufix: pass settings to from Radix to AspectCalculator --------- Co-authored-by: CI Bot <[email protected]>
- Loading branch information
1 parent
a16fb94
commit 72d8018
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Radix from './radix'; | ||
import SVG from './svg'; | ||
import default_settings from './settings'; | ||
|
||
describe('Radix', () => { | ||
const data = { | ||
planets: { | ||
Sun: [0], | ||
Moon: [90], | ||
}, | ||
cusps: [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330] | ||
}; | ||
|
||
it('should draw aspect lines with default colors', () => { | ||
document.body.innerHTML = '<div id="chart"></div>'; | ||
const settings = default_settings; | ||
const paper = new SVG('chart', 500, 500, settings); | ||
const radix = new Radix(paper, 500, 500, 500, data, settings); | ||
radix.aspects(); | ||
|
||
const aspectLines = document.querySelectorAll('#chart-astrology-aspects > line'); | ||
expect(aspectLines[0].getAttribute('stroke')).toBe(default_settings.ASPECTS.square.color); | ||
}); | ||
|
||
it('should draw aspect lines with custom colors via settings', () => { | ||
document.body.innerHTML = '<div id="chart"></div>'; | ||
|
||
const settings = { | ||
...default_settings, | ||
ASPECTS: { | ||
square: { degree: 90, orbit: 10, color: 'purple' }, | ||
}, | ||
}; | ||
|
||
const paper = new SVG('chart', 500, 500, settings); | ||
const radix = new Radix(paper, 500, 500, 500, data, settings); | ||
radix.aspects(); | ||
|
||
const aspectLines = document.querySelectorAll('#chart-astrology-aspects > line'); | ||
expect(aspectLines[0].getAttribute('stroke')).toBe('purple'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters