-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(icon): initial md-icon implementation (#281)
- Loading branch information
Showing
17 changed files
with
1,255 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { | ||
Response, | ||
ResponseOptions} from 'angular2/http'; | ||
|
||
/** | ||
* Fake URLs and associated SVG documents used by tests. | ||
*/ | ||
const FAKE_SVGS = (() => { | ||
const svgs = new Map<string, string>(); | ||
svgs.set('cat.svg', | ||
'<svg><path id="meow"></path></svg>'); | ||
|
||
svgs.set('dog.svg', | ||
'<svg><path id="woof"></path></svg>'); | ||
|
||
svgs.set('farm-set-1.svg', ` | ||
<svg> | ||
<defs> | ||
<g id="pig"><path id="oink"></path></g> | ||
<g id="cow"><path id="moo"></path></g> | ||
</defs> | ||
</svg> | ||
`); | ||
|
||
svgs.set('farm-set-2.svg', ` | ||
<svg> | ||
<defs> | ||
<g id="cow"><path id="moo moo"></path></g> | ||
<g id="sheep"><path id="baa"></path></g> | ||
</defs> | ||
</svg> | ||
`); | ||
|
||
svgs.set('arrow-set.svg', ` | ||
<svg> | ||
<defs> | ||
<svg id="left-arrow"><path id="left"></path></svg> | ||
<svg id="right-arrow"><path id="right"></path></svg> | ||
</defs> | ||
</svg> | ||
`); | ||
|
||
return svgs; | ||
})(); | ||
|
||
/** | ||
* Returns an HTTP response for a fake SVG URL. | ||
*/ | ||
export function getFakeSvgHttpResponse(url: string) { | ||
if (FAKE_SVGS.has(url)) { | ||
return new Response(new ResponseOptions({ | ||
status: 200, | ||
body: FAKE_SVGS.get(url), | ||
})); | ||
} else { | ||
return new Response(new ResponseOptions({status: 404})); | ||
} | ||
} |
Oops, something went wrong.