feat: 🎸 OrderedSeriesDiagram component (#1573)
* feat: 🎸 OrderedSeriesDiagram component Created `orderd-series-diagram` component to look a the state of the ingress and egress filters and determine which diagram should be displayed. ✅ Closes: ICU-6459 * refactor: 💡 sass lint fix Fixed sass lint errors ✅ Closes: ICU-7347 * Update app.scss added closing tag * refactor: 💡 refactor of styling and test Refactored styling for `ordered-series-diagram` to match mocks, and fixed indent errors in test. ✅ Closes: ICU-7347 * refactor: 💡 clean up testing errors Clean up testing errors for `ordered-series-diagram` * refactor: 💡 refactor series diagram (#1577) * refactor: 💡 merge refactor changes and fix test Merged refactor changes to ordered series diagram and fix tests ✅ Closes: ICU-7347 Co-authored-by: Randall Morey <randall@randallmorey.com>
This commit is contained in:
1 parent
b02dc0aa43
commit
cf66235948
7 files changed
+214
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'admin/tests/helpers';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module(
|
||||
'Integration | Component | ordered-series-diagram/group/index',
|
||||
function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders group icons with highlight background', async function (assert) {
|
||||
assert.expect(7);
|
||||
|
||||
await render(hbs`
|
||||
<OrderedSeriesDiagram::Group @title='Private Network' @color='highlight'>
|
||||
<OrderedSeriesDiagram::Item @icon='user'>
|
||||
Client
|
||||
</OrderedSeriesDiagram::Item>
|
||||
<OrderedSeriesDiagram::Item @icon='settings'>
|
||||
Egress Worker
|
||||
</OrderedSeriesDiagram::Item>
|
||||
</OrderedSeriesDiagram::Group>
|
||||
`);
|
||||
|
||||
assert
|
||||
.dom('.ordered-series-diagram-group-content')
|
||||
.hasClass('hds-surface-highlight');
|
||||
assert
|
||||
.dom('.ordered-series-diagram-group-title')
|
||||
.hasText('Private Network');
|
||||
assert.dom('[data-test-icon="user"]').isVisible();
|
||||
assert.dom('[data-test-icon="arrow-right"]').isVisible();
|
||||
assert
|
||||
.dom('.ordered-series-diagram-item .ordered-series-diagram-item-title')
|
||||
.hasText('Client');
|
||||
assert.dom('[data-test-icon="settings"]').isVisible();
|
||||
assert
|
||||
.dom(
|
||||
'.ordered-series-diagram-item:last-child .ordered-series-diagram-item-title'
|
||||
)
|
||||
.hasText('Egress Worker');
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,31 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'admin/tests/helpers';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module(
|
||||
'Integration | Component | ordered-series-diagram/index',
|
||||
function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders two icon series', async function (assert) {
|
||||
assert.expect(5);
|
||||
await render(hbs`
|
||||
<OrderedSeriesDiagram as |D|>
|
||||
<D.Item @icon='user'>Client</D.Item>
|
||||
<D.Item @icon='settings'>Egress Worker</D.Item>
|
||||
</OrderedSeriesDiagram>
|
||||
`);
|
||||
|
||||
assert.dom('[data-test-icon="user"]').isVisible();
|
||||
assert.dom('.ordered-series-diagram-item-title').hasText('Client');
|
||||
assert.dom('[data-test-icon="arrow-right"]').isVisible();
|
||||
assert.dom('[data-test-icon="settings"]').isVisible();
|
||||
assert
|
||||
.dom(
|
||||
'.ordered-series-diagram-item:last-child .ordered-series-diagram-item-title'
|
||||
)
|
||||
.hasText('Egress Worker');
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,24 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'admin/tests/helpers';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module(
|
||||
'Integration | Component | ordered-series-diagram/item/index',
|
||||
function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders with icon and text', async function (assert) {
|
||||
assert.expect(2);
|
||||
|
||||
await render(hbs`
|
||||
<OrderedSeriesDiagram::Item @icon='user'>
|
||||
Client
|
||||
</OrderedSeriesDiagram::Item>
|
||||
`);
|
||||
|
||||
assert.dom('[data-test-icon="user"]').isVisible();
|
||||
assert.dom('.ordered-series-diagram-item-title').hasText('Client');
|
||||
});
|
||||
}
|
||||
);
|
||||
Reference in new issue
Block a user