More utility components

One for a "map" of sorts and one for selecting one element of a list
This commit is contained in:
Melody Becker 2024-10-25 16:54:11 +02:00
parent 07614e9a6d
commit f0638af99f
5 changed files with 127 additions and 0 deletions

View file

@ -0,0 +1,26 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | util/map-edit', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Util::MapEdit />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Util::MapEdit>
template block text
</Util::MapEdit>
`);
assert.dom().hasText('template block text');
});
});

View file

@ -0,0 +1,26 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | util/one-of-array', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Util::OneOfArray />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Util::OneOfArray>
template block text
</Util::OneOfArray>
`);
assert.dom().hasText('template block text');
});
});