Skip to content

Commit cbc2d51

Browse files
committed
Enable all tests
1 parent 09666fd commit cbc2d51

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
@@ -293,7 +293,7 @@ foo
293293
=========="
294294
`;
295295
296-
exports[`native components handles \`classNameBindings\` correctly 1`] = `
296+
exports[`native components handles \`@classNameBindings\` correctly 1`] = `
297297
"==========
298298
299299
import { classNameBindings } from '@ember-decorators/component';
@@ -321,7 +321,7 @@ foo
321321
=========="
322322
`;
323323
324-
exports[`native components handles \`classNames\` correctly 1`] = `
324+
exports[`native components handles \`@classNames\` correctly 1`] = `
325325
"==========
326326
327327
import { classNames } from '@ember-decorators/component';
@@ -373,7 +373,35 @@ foo
373373
=========="
374374
`;
375375
376-
exports[`native components handles single \`classNames\` item correctly 1`] = `
376+
exports[`native components handles \`hasComponentCSS\` option correctly 1`] = `
377+
"==========
378+
379+
import { classNames } from '@ember-decorators/component';
380+
381+
@classNames('foo', 'bar:baz')
382+
export default class extends Component {
383+
}
384+
385+
~~~~~~~~~~
386+
foo
387+
~~~~~~~~~~
388+
=> tagName: div
389+
~~~~~~~~~~
390+
391+
import { tagName } from '@ember-decorators/component';
392+
393+
@tagName(\\"\\")
394+
export default class extends Component {
395+
}
396+
397+
~~~~~~~~~~
398+
<div class=\\"{{styleNamespace}} foo bar:baz\\" ...attributes>
399+
foo
400+
</div>
401+
=========="
402+
`;
403+
404+
exports[`native components handles single \`@classNames\` item correctly 1`] = `
377405
"==========
378406
379407
import { classNames } from '@ember-decorators/component';
@@ -401,6 +429,32 @@ foo
401429
=========="
402430
`;
403431
432+
exports[`native components multi-line template 1`] = `
433+
"==========
434+
export default class extends Component {};
435+
~~~~~~~~~~
436+
{{#if this.foo}}
437+
FOO
438+
{{else}}
439+
BAR
440+
{{/if}}
441+
~~~~~~~~~~
442+
=> tagName: div
443+
~~~~~~~~~~
444+
import { tagName } from \\"@ember-decorators/component\\";
445+
@tagName(\\"\\")
446+
export default class extends Component {}
447+
~~~~~~~~~~
448+
<div ...attributes>
449+
{{#if this.foo}}
450+
FOO
451+
{{else}}
452+
BAR
453+
{{/if}}
454+
</div>
455+
=========="
456+
`;
457+
404458
exports[`native components replaces existing \`tagName\` 1`] = `
405459
"==========
406460

lib/__tests__/transform.js

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

311-
test('handles `classNames` correctly', () => {
311+
test('handles `@classNames` correctly', () => {
312312
let source = `
313313
import { classNames } from '@ember-decorators/component';
314314
@@ -322,7 +322,7 @@ describe('native components', function() {
322322
expect(generateSnapshot(source, template)).toMatchSnapshot();
323323
});
324324

325-
test('handles single `classNames` item correctly', () => {
325+
test('handles single `@classNames` item correctly', () => {
326326
let source = `
327327
import { classNames } from '@ember-decorators/component';
328328
@@ -336,7 +336,7 @@ describe('native components', function() {
336336
expect(generateSnapshot(source, template)).toMatchSnapshot();
337337
});
338338

339-
test('handles `classNameBindings` correctly', () => {
339+
test('handles `@classNameBindings` correctly', () => {
340340
let source = `
341341
import { classNameBindings } from '@ember-decorators/component';
342342
@@ -422,30 +422,32 @@ describe('native components', function() {
422422
`"Using \`click()\` is not supported in tagless components"`
423423
);
424424
});
425-
//
426-
// test('multi-line template', () => {
427-
// let source = `export default Component.extend({});`;
428-
//
429-
// let template = `
430-
// {{#if this.foo}}
431-
// FOO
432-
// {{else}}
433-
// BAR
434-
// {{/if}}
435-
// `.trim();
436-
//
437-
// expect(generateSnapshot(source, template)).toMatchSnapshot();
438-
// });
439-
//
440-
// test('handles `hasComponentCSS` option correctly', () => {
441-
// let source = `
442-
// export default Component.extend({
443-
// classNames: ['foo', 'bar:baz'],
444-
// });
445-
// `;
446-
//
447-
// let template = `foo`;
448-
//
449-
// expect(generateSnapshot(source, template, { hasComponentCSS: true })).toMatchSnapshot();
450-
// });
425+
426+
test('multi-line template', () => {
427+
let source = `export default class extends Component {};`;
428+
429+
let template = `
430+
{{#if this.foo}}
431+
FOO
432+
{{else}}
433+
BAR
434+
{{/if}}
435+
`.trim();
436+
437+
expect(generateSnapshot(source, template)).toMatchSnapshot();
438+
});
439+
440+
test('handles `hasComponentCSS` option correctly', () => {
441+
let source = `
442+
import { classNames } from '@ember-decorators/component';
443+
444+
@classNames('foo', 'bar:baz')
445+
export default class extends Component {
446+
}
447+
`;
448+
449+
let template = `foo`;
450+
451+
expect(generateSnapshot(source, template, { hasComponentCSS: true })).toMatchSnapshot();
452+
});
451453
});

0 commit comments

Comments
 (0)