mirror of https://github.com/sveltejs/svelte
				
				
				
			Merge pull request #362 from sveltejs/gh-331
	
		
	
				
					
				
			Add CSS to each document a component is rendered topull/370/head
						commit
						6fdbe52726
					
				| @ -0,0 +1,21 @@ | |||||||
|  | export default { | ||||||
|  | 	test ( assert, component, target, window ) { | ||||||
|  | 		const iframe = window.document.createElement('iframe'); | ||||||
|  | 		window.document.body.appendChild(iframe); | ||||||
|  | 
 | ||||||
|  | 		const otherTarget = iframe.contentWindow.document.body; | ||||||
|  | 
 | ||||||
|  | 		new component.constructor({ | ||||||
|  | 			target: otherTarget | ||||||
|  | 		}); | ||||||
|  | 
 | ||||||
|  | 		assert.equal( | ||||||
|  | 			window.getComputedStyle(target.querySelector('h1')).color, | ||||||
|  | 			'rgb(255, 0, 0)' | ||||||
|  | 		); | ||||||
|  | 		assert.equal( | ||||||
|  | 			window.getComputedStyle(otherTarget.querySelector('h1')).color, | ||||||
|  | 			'rgb(255, 0, 0)' | ||||||
|  | 		); | ||||||
|  | 	} | ||||||
|  | }; | ||||||
| @ -0,0 +1,6 @@ | |||||||
|  | <h1>Just some static HTML</h1> | ||||||
|  | <style> | ||||||
|  | h1 { | ||||||
|  | 	color: rgb(255, 0, 0); | ||||||
|  | } | ||||||
|  | </style> | ||||||
					Loading…
					
					
				
		Reference in new issue