Simplify Toolbar Link components

This commit is contained in:
Joshua Ogle 2019-04-29 09:19:03 -06:00
parent f2e4892e8e
commit 0fb9ba3ee5
40 changed files with 154 additions and 131 deletions

View File

@ -1,5 +1,3 @@
import Component from '@ember/component'; import OuterHTML from './outer-html';
export default Component.extend({ export default OuterHTML.extend({});
classNames: ['toolbar-actions'],
});

View File

@ -1,5 +0,0 @@
import LinkComponent from '@ember/routing/link-component';
export default LinkComponent.extend({
classNames: ['toolbar-button'],
});

View File

@ -1,6 +0,0 @@
import LinkComponent from '@ember/routing/link-component';
export default LinkComponent.extend({
classNames: ['toolbar-button'],
glyph: 'chevron-right',
});

View File

@ -1,5 +1,5 @@
import DownloadButton from './download-button'; import DownloadButton from './download-button';
export default DownloadButton.extend({ export default DownloadButton.extend({
classNames: ['toolbar-button'], classNames: ['toolbar-link'],
}); });

View File

@ -1,5 +1,3 @@
import Component from '@ember/component'; import OuterHTML from './outer-html';
export default Component.extend({ export default OuterHTML.extend({});
classNames: ['toolbar-filters'],
});

View File

@ -0,0 +1,14 @@
import OuterHTML from './outer-html';
import { computed } from '@ember/object';
export default OuterHTML.extend({
glyph: computed('type', function() {
if (this.type == 'add') {
return 'plus-plain';
} else {
return 'chevron-right';
}
}),
tagName: 'span',
type: null,
});

View File

@ -1,6 +1,13 @@
import SecretLink from './secret-link'; import OuterHTML from './outer-html';
import { computed } from '@ember/object';
export default SecretLink.extend({ export default OuterHTML.extend({
class: 'toolbar-button', glyph: computed('type', function() {
glyph: 'chevron-right', if (this.type == 'add') {
return 'plus-plain';
} else {
return 'chevron-right';
}
}),
tagName: 'span',
}); });

View File

@ -1,6 +1,6 @@
import Component from '@ember/component'; import OuterHTML from './outer-html';
export default Component.extend({ export default OuterHTML.extend({
classNames: ['toolbar'], classNames: ['toolbar'],
tagName: 'nav', tagName: 'nav',
}); });

View File

@ -4,20 +4,19 @@
.toolbar { .toolbar {
background-color: $ui-gray-010; background-color: $ui-gray-010;
border: 1px solid $ui-gray-200; border: 1px solid $ui-gray-100;
border-bottom-color: $ui-gray-300; border-bottom-color: $ui-gray-300;
border-top-color: $ui-gray-300; border-top-color: $ui-gray-300;
position: relative; position: relative;
&::after { &::after {
background: linear-gradient(to right, rgba($ui-gray-010, 0), $ui-gray-010); background: linear-gradient(to right, $ui-gray-010, rgba($ui-gray-010, 0));
border-radius: $radius-large; bottom: 0;
bottom: 1px;
content: ''; content: '';
position: absolute; position: absolute;
right: 1px; right: 0;
top: 1px; top: 0;
width: $spacing-s; width: $spacing-xxs;
z-index: 2; z-index: 2;
} }
@ -72,7 +71,7 @@
} }
} }
.toolbar-button { .toolbar-link {
@extend .button; @extend .button;
@extend .is-ghost; @extend .is-ghost;
@extend .has-icon-right; @extend .has-icon-right;

View File

@ -29,18 +29,19 @@
{{/if}} {{/if}}
<ToolbarActions> <ToolbarActions>
{{#if (eq identityType "entity")}} {{#if (eq identityType "entity")}}
<ToolbarButton <ToolbarLink
@params={{array "vault.cluster.access.identity.merge" (pluralize identityType)}} @params={{array "vault.cluster.access.identity.merge" (pluralize identityType)}}
data-test-entity-merge-link=true @data-test-entity-merge-link=true
> >
Merge {{pluralize identityType}} Merge {{pluralize identityType}}
</ToolbarButton> </ToolbarLink>
{{/if}} {{/if}}
<ToolbarButton <ToolbarLink
@type="add"
@params={{array "vault.cluster.access.identity.create" (pluralize identityType)}} @params={{array "vault.cluster.access.identity.create" (pluralize identityType)}}
data-test-entity-create-link=true @data-test-entity-create-link=true
> >
Create {{identityType}} Create {{identityType}}
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>

View File

@ -53,7 +53,7 @@
> >
<D.trigger <D.trigger
data-test-popup-menu-trigger="true" data-test-popup-menu-trigger="true"
@class={{concat "popup-menu-trigger toolbar-button" (if D.isOpen " is-active")}} @class={{concat "popup-menu-trigger toolbar-link" (if D.isOpen " is-active")}}
@tagName="button" @tagName="button"
> >
History History
@ -95,7 +95,7 @@
{{#if (and (eq mode 'show') canDelete)}} {{#if (and (eq mode 'show') canDelete)}}
<ConfirmAction <ConfirmAction
@buttonClasses="toolbar-button" @buttonClasses="toolbar-link"
@onConfirmAction={{action "deleteKey"}} @onConfirmAction={{action "deleteKey"}}
@confirmMessage={{if isV2 @confirmMessage={{if isV2
(concat "This will permanently delete " model.id " and all its versions. Are you sure you want to do this?") (concat "This will permanently delete " model.id " and all its versions. Are you sure you want to do this?")
@ -121,7 +121,7 @@
> >
<D.trigger <D.trigger
data-test-popup-menu-trigger="true" data-test-popup-menu-trigger="true"
@class={{concat "toolbar-button" (if D.isOpen " is-active")}} @class={{concat "toolbar-link" (if D.isOpen " is-active")}}
@tagName="button" @tagName="button"
> >
Copy secret Copy secret
@ -169,21 +169,22 @@
{{/unless}} {{/unless}}
{{#if isV2}} {{#if isV2}}
<ToolbarAddButton <ToolbarLink
@params={{array targetRoute model.id (query-params version=this.modelForData.version)}} @params={{array targetRoute model.id (query-params version=this.modelForData.version)}}
@data-test-secret-edit="true" @data-test-secret-edit="true"
@replace={{true}} @replace={{true}}
@type="add"
> >
Create new version Create new version
</ToolbarAddButton> </ToolbarLink>
{{else}} {{else}}
<ToolbarAddButton <ToolbarLink
@params={{array targetRoute model.id}} @params={{array targetRoute model.id}}
@data-test-secret-edit="true" @data-test-secret-edit="true"
@replace={{true}} @replace={{true}}
> >
Edit secret Edit secret
</ToolbarAddButton> </ToolbarLink>
{{/if}} {{/if}}
{{/let}} {{/let}}
{{/if}} {{/if}}

View File

@ -6,7 +6,7 @@
> >
<D.trigger <D.trigger
data-test-popup-menu-trigger="true" data-test-popup-menu-trigger="true"
@class={{concat "toolbar-button" (if D.isOpen " is-active")}} @class={{concat "toolbar-link" (if D.isOpen " is-active")}}
@tagName="button" @tagName="button"
> >
{{#if useDefaultTrigger}} {{#if useDefaultTrigger}}

View File

@ -0,0 +1,3 @@
<nav class="toolbar-actions">
{{yield}}
</nav>

View File

@ -1,2 +0,0 @@
{{yield}}
<ICon @glyph="plus-plain" @size=12 />

View File

@ -1,2 +0,0 @@
{{yield}}
<ICon @glyph={{glyph}} @size=12 />

View File

@ -0,0 +1,3 @@
<nav class="toolbar-filters">
{{yield}}
</nav>

View File

@ -0,0 +1,17 @@
<LinkTo
@class="toolbar-link"
@params={{params}}
@data-test-secret-edit={{data-test-secret-edit}}
@data-test-secondary-add={{data-test-secondary-add}}
@data-test-configure-link={{data-test-configure-link}}
@data-test-alias-edit-link={{data-test-alias-edit-link}}
@data-test-entity-merge-link={{data-test-entity-merge-link}}
@data-test-backend-view-link={{data-test-backend-view-link}}
@data-test-entity-create-link={{data-test-entity-create-link}}
@data-test-policy-create-link={{data-test-policy-create-link}}
@data-test-policy-edit-toggle={{data-test-policy-edit-toggle}}
@data-test-secret-backend-configure={{data-test-secret-backend-configure}}
>
{{yield}}
<ICon @glyph={{glyph}} @size=12 />
</LinkTo>

View File

@ -1,17 +1,18 @@
<SecretLink <SecretLink
@class="toolbar-button" @class="toolbar-link"
@mode={{mode}} @mode={{mode}}
@secret={{secret}} @secret={{secret}}
@queryParams={{queryParams}} @queryParams={{queryParams}}
@data-test-secret-create={{data-test-secret-create}}
@data-test-credentials-link={{data-test-credentials-link}}
@data-test-backend-credentials={{data-test-backend-credentials}}
@data-test-edit-link={{data-test-edit-link}} @data-test-edit-link={{data-test-edit-link}}
@data-test-sign-link={{data-test-sign-link}} @data-test-sign-link={{data-test-sign-link}}
@data-test-transit-link={{data-test-transit-link}} @data-test-transit-link={{data-test-transit-link}}
@data-test-transit-key-actions-link={{data-test-transit-key-actions-link}} @data-test-secret-create={{data-test-secret-create}}
@data-test-credentials-link={{data-test-credentials-link}}
@data-test-backend-credentials={{data-test-backend-credentials}}
@data-test-transit-action-link={{data-test-transit-action-link}} @data-test-transit-action-link={{data-test-transit-action-link}}
@replace={{replace}}> @data-test-transit-key-actions-link={{data-test-transit-key-actions-link}}
@replace={{replace}}
>
{{yield}} {{yield}}
<ICon @glyph={{glyph}} @size=12 /> <ICon @glyph={{glyph}} @size=12 />
</SecretLink> </SecretLink>

View File

@ -1,7 +1,7 @@
{{#if (eq selectedAction 'rotate')}} {{#if (eq selectedAction 'rotate')}}
{{#if key.canRotate}} {{#if key.canRotate}}
{{#confirm-action {{#confirm-action
buttonClasses="toolbar-button" buttonClasses="toolbar-link"
onConfirmAction=(action "doSubmit") onConfirmAction=(action "doSubmit")
confirmMessage=(concat 'Are you sure you want to rotate "' key.id '"?') confirmMessage=(concat 'Are you sure you want to rotate "' key.id '"?')
confirmButtonText="Confirm rotation" confirmButtonText="Confirm rotation"

View File

@ -9,9 +9,9 @@
{{#if model.canConfigure}} {{#if model.canConfigure}}
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton @params={{array 'vault.cluster.access.control-groups-configure'}}> <ToolbarLink @params={{array 'vault.cluster.access.control-groups-configure'}}>
Configure Configure
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>
{{/if}} {{/if}}

View File

@ -9,9 +9,9 @@
{{#if model.canConfigure}} {{#if model.canConfigure}}
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton @params={{array 'vault.cluster.access.control-groups-configure'}}> <ToolbarLink @params={{array 'vault.cluster.access.control-groups-configure'}}>
Configure Configure
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>
{{/if}} {{/if}}

View File

@ -32,12 +32,12 @@
</div> </div>
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton <ToolbarLink
@params={{array "vault.cluster.access.identity.aliases.edit" model.id}} @params={{array "vault.cluster.access.identity.aliases.edit" model.id}}
data-test-alias-edit-link=true @data-test-alias-edit-link=true
> >
Edit {{lowercase (humanize model.identityType)}} Edit {{lowercase (humanize model.identityType)}}
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>
{{component (concat 'identity/item-alias/alias-' section) model=model}} {{component (concat 'identity/item-alias/alias-' section) model=model}}

View File

@ -33,15 +33,20 @@
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
{{#unless (or (and (eq model.identityType "group") (eq model.type "internal")) model.alias)}} {{#unless (or (and (eq model.identityType "group") (eq model.type "internal")) model.alias)}}
{{#link-to "vault.cluster.access.identity.aliases.add" (pluralize model.identityType) model.id class="button has-icon-right is-ghost is-compact" data-test-entity-create-link=true}} <ToolbarLink
@type="add"
@params={{array "vault.cluster.access.identity.aliases.add" (pluralize model.identityType) model.id}}
@data-test-entity-create-link=true
>
Add alias Add alias
{{i-con glyph="chevron-right" size=11}} </ToolbarLink>
{{/link-to}}
{{/unless}} {{/unless}}
{{#link-to "vault.cluster.access.identity.edit" (pluralize model.identityType) model.id class="button has-icon-right is-ghost is-compact" data-test-entity-edit-link=true}} <ToolbarLink
@params={{array "vault.cluster.access.identity.edit" (pluralize model.identityType) model.id}}
@data-test-entity-edit-link=true
>
Edit {{model.identityType}} Edit {{model.identityType}}
{{i-con glyph="chevron-right" size=11}} </ToolbarLink>
{{/link-to}}
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>
{{component (concat 'identity/item-' section) model=model}} {{component (concat 'identity/item-' section) model=model}}

View File

@ -19,12 +19,12 @@
{{#if (eq section "configuration")}} {{#if (eq section "configuration")}}
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton <ToolbarLink
@params={{array "vault.cluster.settings.auth.configure" model.id}} @params={{array "vault.cluster.settings.auth.configure" model.id}}
data-test-configure-link=true @data-test-configure-link=true
> >
Configure Configure
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>
{{/if}} {{/if}}

View File

@ -8,9 +8,12 @@
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton @params={{array 'vault.cluster.settings.auth.enable'}}> <ToolbarLink
@type="add"
@params={{array 'vault.cluster.settings.auth.enable'}}
>
Enable new method Enable new method
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>

View File

@ -9,9 +9,12 @@
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton @params={{array 'vault.cluster.access.namespaces.create'}}> <ToolbarLink
@type="add"
@params={{array 'vault.cluster.access.namespaces.create'}}
>
Create namespace Create namespace
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>

View File

@ -22,7 +22,7 @@
<label for="policy-name" class="is-label">Name</label> <label for="policy-name" class="is-label">Name</label>
<div class="control"> <div class="control">
<input <input
type="text"nn type="text"
id="policy-name" id="policy-name"
class="input" class="input"
value={{model.name}} value={{model.name}}

View File

@ -38,12 +38,13 @@
{{/if}} {{/if}}
</ToolbarFilters> </ToolbarFilters>
<ToolbarActions> <ToolbarActions>
<ToolbarButton <ToolbarLink
@type="add"
@params={{array 'vault.cluster.policies.create'}} @params={{array 'vault.cluster.policies.create'}}
data-test-policy-create-link=true @data-test-policy-create-link=true
> >
Create {{uppercase policyType}} policy Create {{uppercase policyType}} policy
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>
{{#each model as |item|}} {{#each model as |item|}}

View File

@ -23,16 +23,16 @@
{{#if (and (not-eq model.id "root") (or capabilities.canUpdate capabilities.canDelete))}} {{#if (and (not-eq model.id "root") (or capabilities.canUpdate capabilities.canDelete))}}
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton <ToolbarLink
@params={{array 'vault.cluster.policy.show' model.id}} @params={{array 'vault.cluster.policy.show' model.id}}
data-test-policy-edit-toggle=true @data-test-policy-edit-toggle=true
> >
Back to policy Back to policy
</ToolbarButton> </ToolbarLink>
<div class="toolbar-separator" /> <div class="toolbar-separator" />
{{#if (and (not-eq model.id "default") capabilities.canDelete)}} {{#if (and (not-eq model.id "default") capabilities.canDelete)}}
{{#confirm-action {{#confirm-action
buttonClasses="toolbar-button" buttonClasses="toolbar-link"
onConfirmAction=(action "deletePolicy" model) onConfirmAction=(action "deletePolicy" model)
confirmMessage=(concat "Are you sure you want to delete " model.id "?") confirmMessage=(concat "Are you sure you want to delete " model.id "?")
data-test-policy-delete=true data-test-policy-delete=true

View File

@ -23,19 +23,19 @@
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarDownloadButton <ToolbarDownloadButton
@classNames="toolbar-button" @classNames="toolbar-link"
@actionText="Download policy" @actionText="Download policy"
@extension={{if (eq policyType "acl") model.format "sentinel"}} @extension={{if (eq policyType "acl") model.format "sentinel"}}
@filename=model.name @filename=model.name
@data=model.policy @data=model.policy
/> />
{{#if (and (not-eq model.id "root") (or capabilities.canUpdate capabilities.canDelete))}} {{#if (and (not-eq model.id "root") (or capabilities.canUpdate capabilities.canDelete))}}
<ToolbarButton <ToolbarLink
@params={{array 'vault.cluster.policy.edit' model.id}} @params={{array 'vault.cluster.policy.edit' model.id}}
data-test-policy-edit-toggle=true @data-test-policy-edit-toggle=true
> >
Edit policy Edit policy
</ToolbarButton> </ToolbarLink>
{{/if}} {{/if}}
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>

View File

@ -3,21 +3,21 @@
<ToolbarActions> <ToolbarActions>
{{#if model.replicationAttrs.knownSecondaries.length}} {{#if model.replicationAttrs.knownSecondaries.length}}
{{#if model.canRevokeSecondary}} {{#if model.canRevokeSecondary}}
<ToolbarButton <ToolbarLink
@params={{array 'vault.cluster.replication.mode.secondaries.revoke' model.name replicationMode}} @params={{array 'vault.cluster.replication.mode.secondaries.revoke' model.name replicationMode}}
data-test-secondary-add=true
> >
Revoke secondary Revoke secondary
</ToolbarButton> </ToolbarLink>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if model.canAddSecondary}} {{#if model.canAddSecondary}}
<ToolbarAddButton <ToolbarLink
@type="add"
@params={{array 'vault.cluster.replication.mode.secondaries.add' model.name replicationMode}} @params={{array 'vault.cluster.replication.mode.secondaries.add' model.name replicationMode}}
@data-test-secondary-add=true @data-test-secondary-add=true
> >
Add secondary Add secondary
</ToolbarAddButton> </ToolbarLink>
{{/if}} {{/if}}
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>

View File

@ -3,12 +3,12 @@
{{#if (or (eq model.type "aws") (eq model.type "ssh") (eq model.type "pki"))}} {{#if (or (eq model.type "aws") (eq model.type "ssh") (eq model.type "pki"))}}
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton <ToolbarLink
@params={{array 'vault.cluster.settings.configure-secret-backend' model.id}} @params={{array 'vault.cluster.settings.configure-secret-backend' model.id}}
data-test-secret-backend-configure=true @data-test-secret-backend-configure=true
> >
Configure Configure
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>
{{/if}} {{/if}}

View File

@ -39,7 +39,7 @@
<ToolbarSecretLink <ToolbarSecretLink
@secret='' @secret=''
@mode="create" @mode="create"
@glyph="plus-plain" @type="add"
@queryParams={{query-params initialKey=(or filter baseKey.id)}} @queryParams={{query-params initialKey=(or filter baseKey.id)}}
@data-test-secret-create=true @data-test-secret-create=true
> >

View File

@ -8,9 +8,12 @@
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarAddButton @params={{array 'vault.cluster.settings.mount-secret-backend'}}> <ToolbarLink
@type="add"
@params={{array 'vault.cluster.settings.mount-secret-backend'}}
>
Enable new engine Enable new engine
</ToolbarAddButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>

View File

@ -18,12 +18,12 @@
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton <ToolbarLink
@params={{array "vault.cluster.access.method" model.id}} @params={{array "vault.cluster.access.method" model.id}}
data-test-backend-view-link=true @data-test-backend-view-link=true
> >
View method View method
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>

View File

@ -16,12 +16,12 @@
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarButton <ToolbarLink
@params={{array "vault.cluster.secrets.backend" model.id}} @params={{array "vault.cluster.secrets.backend" model.id}}
data-test-backend-view-link=true @data-test-backend-view-link=true
> >
View backend View backend
</ToolbarButton> </ToolbarLink>
</ToolbarActions> </ToolbarActions>
</Toolbar> </Toolbar>

View File

@ -51,8 +51,6 @@ const OIDC_AUTH_RESPONSE = {
}, },
}; };
const WAIT_TIME = 50;
const routerStub = Service.extend({ const routerStub = Service.extend({
urlFor() { urlFor() {
return 'http://example.com'; return 'http://example.com';

View File

@ -1,17 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { isPresent } from 'ember-cli-page-object';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | toolbar-add-button', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
await render(hbs`<ToolbarAddButton @params={{array "/"}}>Link</ToolbarAddButton>`);
assert.equal(this.element.textContent.trim(), 'Link');
assert.ok(isPresent('.toolbar-button'));
assert.ok(isPresent('.icon'));
});
});

View File

@ -11,7 +11,7 @@ module('Integration | Component | toolbar-download-button', function(hooks) {
await render(hbs`<ToolbarDownloadButton @actionText="Link" />`); await render(hbs`<ToolbarDownloadButton @actionText="Link" />`);
assert.equal(this.element.textContent.trim(), 'Link'); assert.equal(this.element.textContent.trim(), 'Link');
assert.ok(isPresent('.toolbar-button')); assert.ok(isPresent('.toolbar-link'));
assert.ok(isPresent('.icon')); assert.ok(isPresent('.icon'));
}); });
}); });

View File

@ -4,14 +4,14 @@ import { render } from '@ember/test-helpers';
import { isPresent } from 'ember-cli-page-object'; import { isPresent } from 'ember-cli-page-object';
import hbs from 'htmlbars-inline-precompile'; import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | toolbar-button', function(hooks) { module('Integration | Component | toolbar-link', function(hooks) {
setupRenderingTest(hooks); setupRenderingTest(hooks);
test('it renders', async function(assert) { test('it renders', async function(assert) {
await render(hbs`<ToolbarButton @params="/secrets">Link</ToolbarButton>`); await render(hbs`<ToolbarLink @params="/secrets">Link</ToolbarLink>`);
assert.equal(this.element.textContent.trim(), 'Link'); assert.equal(this.element.textContent.trim(), 'Link');
assert.ok(isPresent('.toolbar-button')); assert.ok(isPresent('.toolbar-link'));
assert.ok(isPresent('.icon')); assert.ok(isPresent('.icon'));
}); });
}); });