mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-16 22:09:57 +02:00
Missed test case for allowing site owner to append to secure
field set
Missed logic for default-appending src array values where not existing within dst array in assignWithDepth function
This commit is contained in:
@@ -65,6 +65,28 @@ describe('when using mermaidAPI and ', function() {
|
||||
expect(mermaidAPI.getSiteConfig()).toEqual(siteConfig)
|
||||
expect(mermaidAPI.getConfig()).toEqual(siteConfig);
|
||||
});
|
||||
it('should allow site config secure to global defaults', function() {
|
||||
let config = {
|
||||
logLevel: 0,
|
||||
secure: ['foo']
|
||||
};
|
||||
mermaidAPI.initialize(config);
|
||||
const siteConfig = mermaidAPI.getSiteConfig();
|
||||
expect(mermaidAPI.getConfig().logLevel).toBe(0);
|
||||
expect(mermaidAPI.getConfig().secure).toContain('foo');
|
||||
config = {
|
||||
logLevel: 3,
|
||||
securityLevel: 'loose',
|
||||
secure: ['foo', 'bar']
|
||||
};
|
||||
mermaidAPI.reinitialize(config);
|
||||
expect(mermaidAPI.getConfig().secure).toEqual(mermaidAPI.getSiteConfig().secure);
|
||||
expect(mermaidAPI.getConfig().securityLevel).toBe('strict');
|
||||
expect(mermaidAPI.getConfig().secure).not.toContain('bar');
|
||||
mermaidAPI.reset();
|
||||
expect(mermaidAPI.getSiteConfig()).toEqual(siteConfig)
|
||||
expect(mermaidAPI.getConfig()).toEqual(siteConfig);
|
||||
});
|
||||
it('should prevent changes to site defaults (sneaky)', function() {
|
||||
let config = {
|
||||
logLevel: 0
|
||||
|
Reference in New Issue
Block a user