vault/ui/tests/integration/components/selectable-card-test.js
claire bontempo a5b60cd8cc
UI: move selectable card to add-on (#23739)
* remove title-number class and consolidate border radius

* move selectable card to core addon

* add top padding to db cards

* update transform icon color

* new selectable card component

* fix db test

* use selectable card in mount backend form

* fix query param for overview card

* update tests

* fix replication card styling

* make card accessible;

* update tabindex

* change to standalone for error handling

* update test selector

* update tests

* go back to number only css class

* fix on click tests

* add changelog

* update class name in template file

* delete box radio
2023-10-20 15:10:49 -07:00

30 lines
896 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { click, render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import sinon from 'sinon';
module('Integration | Component selectable-card', function (hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function () {
this.onClick = sinon.spy();
});
test('it renders', async function (assert) {
await render(hbs`<SelectableCard @onClick={{this.onClick}}/>`);
await click('.selectable-card');
assert.ok(this.onClick.calledOnce, 'calls on click');
});
test('it renders block content', async function (assert) {
await render(hbs`<SelectableCard @onClick={{this.onClick}}>hello</SelectableCard>`);
assert.dom('.selectable-card').hasText('hello');
});
});