Skip to content

Commit 40e4b69

Browse files
committed
Enable all tests
1 parent fc678db commit 40e4b69

File tree

2 files changed

+88
-32
lines changed

2 files changed

+88
-32
lines changed

lib/__tests__/__snapshots__/transform.js.snap

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ foo
269269
=========="
270270
`;
271271
272-
exports[`native components handles \`classNameBindings\` correctly 1`] = `
272+
exports[`native components handles \`@classNameBindings\` correctly 1`] = `
273273
"==========
274274
275275
import { classNameBindings } from '@ember-decorators/component';
@@ -297,7 +297,7 @@ foo
297297
=========="
298298
`;
299299
300-
exports[`native components handles \`classNames\` correctly 1`] = `
300+
exports[`native components handles \`@classNames\` correctly 1`] = `
301301
"==========
302302
303303
import { classNames } from '@ember-decorators/component';
@@ -349,7 +349,35 @@ foo
349349
=========="
350350
`;
351351
352-
exports[`native components handles single \`classNames\` item correctly 1`] = `
352+
exports[`native components handles \`hasComponentCSS\` option correctly 1`] = `
353+
"==========
354+
355+
import { classNames } from '@ember-decorators/component';
356+
357+
@classNames('foo', 'bar:baz')
358+
export default class extends Component {
359+
}
360+
361+
~~~~~~~~~~
362+
foo
363+
~~~~~~~~~~
364+
=> tagName: div
365+
~~~~~~~~~~
366+
367+
import { tagName } from '@ember-decorators/component';
368+
369+
@tagName(\\"\\")
370+
export default class extends Component {
371+
}
372+
373+
~~~~~~~~~~
374+
<div class=\\"{{styleNamespace}} foo bar:baz\\" ...attributes>
375+
foo
376+
</div>
377+
=========="
378+
`;
379+
380+
exports[`native components handles single \`@classNames\` item correctly 1`] = `
353381
"==========
354382
355383
import { classNames } from '@ember-decorators/component';
@@ -377,6 +405,32 @@ foo
377405
=========="
378406
`;
379407
408+
exports[`native components multi-line template 1`] = `
409+
"==========
410+
export default class extends Component {};
411+
~~~~~~~~~~
412+
{{#if this.foo}}
413+
FOO
414+
{{else}}
415+
BAR
416+
{{/if}}
417+
~~~~~~~~~~
418+
=> tagName: div
419+
~~~~~~~~~~
420+
import { tagName } from \\"@ember-decorators/component\\";
421+
@tagName(\\"\\")
422+
export default class extends Component {}
423+
~~~~~~~~~~
424+
<div ...attributes>
425+
{{#if this.foo}}
426+
FOO
427+
{{else}}
428+
BAR
429+
{{/if}}
430+
</div>
431+
=========="
432+
`;
433+
380434
exports[`native components replaces existing \`tagName\` 1`] = `
381435
"==========
382436

lib/__tests__/transform.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ describe('native components', function() {
271271
expect(generateSnapshot(source, template)).toMatchSnapshot();
272272
});
273273

274-
test('handles `classNames` correctly', () => {
274+
test('handles `@classNames` correctly', () => {
275275
let source = `
276276
import { classNames } from '@ember-decorators/component';
277277
@@ -285,7 +285,7 @@ describe('native components', function() {
285285
expect(generateSnapshot(source, template)).toMatchSnapshot();
286286
});
287287

288-
test('handles single `classNames` item correctly', () => {
288+
test('handles single `@classNames` item correctly', () => {
289289
let source = `
290290
import { classNames } from '@ember-decorators/component';
291291
@@ -299,7 +299,7 @@ describe('native components', function() {
299299
expect(generateSnapshot(source, template)).toMatchSnapshot();
300300
});
301301

302-
test('handles `classNameBindings` correctly', () => {
302+
test('handles `@classNameBindings` correctly', () => {
303303
let source = `
304304
import { classNameBindings } from '@ember-decorators/component';
305305
@@ -385,30 +385,32 @@ describe('native components', function() {
385385
`"Using \`click()\` is not supported in tagless components"`
386386
);
387387
});
388-
//
389-
// test('multi-line template', () => {
390-
// let source = `export default Component.extend({});`;
391-
//
392-
// let template = `
393-
// {{#if this.foo}}
394-
// FOO
395-
// {{else}}
396-
// BAR
397-
// {{/if}}
398-
// `.trim();
399-
//
400-
// expect(generateSnapshot(source, template)).toMatchSnapshot();
401-
// });
402-
//
403-
// test('handles `hasComponentCSS` option correctly', () => {
404-
// let source = `
405-
// export default Component.extend({
406-
// classNames: ['foo', 'bar:baz'],
407-
// });
408-
// `;
409-
//
410-
// let template = `foo`;
411-
//
412-
// expect(generateSnapshot(source, template, { hasComponentCSS: true })).toMatchSnapshot();
413-
// });
388+
389+
test('multi-line template', () => {
390+
let source = `export default class extends Component {};`;
391+
392+
let template = `
393+
{{#if this.foo}}
394+
FOO
395+
{{else}}
396+
BAR
397+
{{/if}}
398+
`.trim();
399+
400+
expect(generateSnapshot(source, template)).toMatchSnapshot();
401+
});
402+
403+
test('handles `hasComponentCSS` option correctly', () => {
404+
let source = `
405+
import { classNames } from '@ember-decorators/component';
406+
407+
@classNames('foo', 'bar:baz')
408+
export default class extends Component {
409+
}
410+
`;
411+
412+
let template = `foo`;
413+
414+
expect(generateSnapshot(source, template, { hasComponentCSS: true })).toMatchSnapshot();
415+
});
414416
});

0 commit comments

Comments
 (0)