]*><\/div>/, markup);
139 | });
140 | });
141 |
142 | describe('with format set as prop', function() {
143 | it('interpolates properly', function() {
144 | var props = {
145 | with: { foo: 'bar', number: 42, comp: React.createElement('i', null, 'baz') },
146 | format: 'lala %(foo)s lulu %(comp)s lili %(number)s lele'
147 | };
148 | var markup = render(Interpolate(props));
149 |
150 | assert.matches(/lala .*?bar.*? lulu .*?baz.*? lili .*?42.*? lele/, markup);
151 | assert.doesNotMatch(/%\(|\)s|foo|comp|number/, markup);
152 | });
153 |
154 | it('interpolates properly when prop is an empty string', function() {
155 | var props = { component: 'div', format: '' };
156 | var markup = render(Interpolate(props));
157 |
158 | assert.matches(/
]*><\/div>/, markup);
159 | });
160 | });
161 |
162 | it('escapes HTML markup in the format string by default', function() {
163 | var format = 'foo bar';
164 | var markup = render(Interpolate(null, format));
165 |
166 | assert.doesNotMatch(/<\/?script>/, markup);
167 | });
168 |
169 | describe('when providing an `unsafe` prop set to `true`', function() {
170 | it('renders HTML markup present in the format string', function() {
171 | var format = 'foo bar';
172 | var markup = render(Interpolate({ unsafe: true, alert: 'Danger!' }, format));
173 |
174 | assert.matches(/