Skip to content

Commit

Permalink
Collapse deprecations by default (emberjs#885)
Browse files Browse the repository at this point in the history
* Collapse deprecations by default, fixes emberjs#454

* Expand deprecations in test
  • Loading branch information
thorsteinsson authored and cyril-sf committed Mar 30, 2022
1 parent 1cffa84 commit c6dfca7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/components/deprecation-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from '@ember/component';
import { notEmpty } from '@ember/object/computed';

export default Component.extend({
isExpanded: true,
isExpanded: false,

tagName: '',

Expand Down
9 changes: 9 additions & 0 deletions tests/acceptance/deprecation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ module('Deprecation Tab', function(hooks) {

await visit('/deprecations');

await click('.js-deprecation-item');

assert.dom('.js-deprecation-source').doesNotExist('no sources');
assert.dom(findAll('.js-deprecation-message')[0]).hasText('Deprecation 1', 'message shown');
assert.dom(findAll('.js-deprecation-count')[0]).hasText('2', 'Count correct');
Expand All @@ -96,6 +98,8 @@ module('Deprecation Tab', function(hooks) {

await visit('/deprecations');

await click('.js-deprecation-item');

assert.dom('.js-deprecation-message').hasText('Deprecation 1', 'message shown');
assert.dom('.js-deprecation-count').hasText('2', 'Count correct');
assert.dom('.js-deprecation-full-trace').doesNotExist('Full trace button not shown');
Expand Down Expand Up @@ -142,6 +146,8 @@ module('Deprecation Tab', function(hooks) {

await visit('/deprecations');

await click('.js-deprecation-item');

assert.dom('.js-deprecation-message').hasText('Deprecation 1', 'message shown');
assert.dom('.js-deprecation-count').hasText('2', 'Count correct');
assert.dom('.js-deprecation-full-trace').doesNotExist('Full trace button not shown');
Expand Down Expand Up @@ -189,6 +195,8 @@ module('Deprecation Tab', function(hooks) {

await visit('/deprecations');

await click('.js-deprecation-item');

let sources = findAll('.js-deprecation-source');
assert.equal(sources.length, 2, 'shows all sources');

Expand All @@ -197,6 +205,7 @@ module('Deprecation Tab', function(hooks) {
assert.equal(sources.length, 0, 'sources filtered');

await click('.js-search-field-clear-button');
await click('.js-deprecation-item');
sources = findAll('.js-deprecation-source');
assert.equal(sources.length, 2, 'show all sources');
});
Expand Down

0 comments on commit c6dfca7

Please sign in to comment.