Skip to content

Commit

Permalink
Drop compat checks which are no longer needed (Addepar#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic authored and kpfefferle committed Jan 20, 2022
1 parent 1f74b8b commit 448dc31
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 48 deletions.
8 changes: 0 additions & 8 deletions addon/components/ember-tbody/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { computed } from '@ember/object';
import { observer } from '../../-private/utils/observer';
import { bool, readOnly, or } from '@ember/object/computed';

import { SUPPORTS_INVERSE_BLOCK } from 'ember-compatibility-helpers';

import CollapseTree, { SELECT_MODE } from '../../-private/collapse-tree';
import defaultTo from '../../-private/utils/default-to';

Expand Down Expand Up @@ -364,10 +362,4 @@ export default Component.extend({
_containerSelector: computed('containerSelector', 'unwrappedApi.tableId', function() {
return this.get('containerSelector') || `#${this.get('unwrappedApi.tableId')}`;
}),

/**
* Determines if the component can yield-to-inverse based on
* the version compatability.
*/
shouldYieldToInverse: SUPPORTS_INVERSE_BLOCK,
});
2 changes: 1 addition & 1 deletion addon/components/ember-tbody/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
{{/if}}
{{/-ember-table-private/row-wrapper}}

{{else if this.shouldYieldToInverse}}
{{else}}
{{yield to='inverse'}}
{{/vertical-collection}}
9 changes: 0 additions & 9 deletions tests/dummy/app/pods/application/controller.js

This file was deleted.

8 changes: 2 additions & 6 deletions tests/dummy/app/pods/application/template.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<div class='font-sans text-black leading-normal'>
{{#if this.canShowAddonDocs}}
{{docs-header}}
{{/if}}
{{docs-header}}

{{outlet}}

{{#if this.canShowAddonDocs}}
{{docs-keyboard-shortcuts}}
{{/if}}
{{docs-keyboard-shortcuts}}
</div>
42 changes: 18 additions & 24 deletions tests/integration/components/basic-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { componentModule } from '../../helpers/module';

import { find, findAll, scrollTo } from 'ember-native-dom-helpers';

import { SUPPORTS_INVERSE_BLOCK } from 'ember-compatibility-helpers';

import TablePage from 'ember-table/test-support/pages/ember-table';
import { collection, hasClass } from 'ember-classy-page-object';
import wait from 'ember-test-helpers/wait';
Expand Down Expand Up @@ -213,30 +211,26 @@ module('Integration | basic', function() {
});

test('it yields to inverse when tbody rows are empty', async function(assert) {
if (!SUPPORTS_INVERSE_BLOCK) {
assert.ok(true, 'Does not support yield-to-inverse');
} else {
this.set('columns', generateColumns(4));
this.set('rows', []);
this.render(hbs`
<div style="height: 500px;">
{{#ember-table as |t|}}
{{ember-thead api=t columns=columns}}
this.set('columns', generateColumns(4));
this.set('rows', []);
this.render(hbs`
<div style="height: 500px;">
{{#ember-table as |t|}}
{{ember-thead api=t columns=this.columns}}
{{#ember-tbody api=t rows=rows as |b|}}
{{else}}
<div data-test-inverse-yield>inverse yield</div>
{{/ember-tbody}}
{{/ember-table}}
</div>
`);
{{#ember-tbody api=t rows=this.rows as |b|}}
{{else}}
<div data-test-inverse-yield>inverse yield</div>
{{/ember-tbody}}
{{/ember-table}}
</div>
`);

await wait();
assert.ok(
find('[data-test-inverse-yield]'),
'expected the inverse yield content to be displayed'
);
}
await wait();
assert.ok(
find('[data-test-inverse-yield]'),
'expected the inverse yield content to be displayed'
);
});

test('Text can be aligned left, center or right', async function(assert) {
Expand Down

0 comments on commit 448dc31

Please sign in to comment.