Skip to content

Commit

Permalink
chore: change data-test...container monenclature
Browse files Browse the repository at this point in the history
  • Loading branch information
Brenion committed Nov 27, 2024
1 parent 7daea16 commit d275782
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ module(
await settled();
assert.dom('[data-test-tpk-bic-input]').hasNoText();
assert
.dom('[data-test-tpk-bic]')
.dom('[data-test-tpk-prefab-bic-container]')
.hasAttribute('data-has-error', 'true');
});


test('CSS classes exist and have been attached to the correct element', async function (this: ThisTestContext,assert) {
await renderComponentAndReturnChangeset.call(this);
assert.dom('.tpk-bic-container').exists().hasAttribute('data-test-tpk-bic');
assert.dom('.tpk-bic-container').exists().hasAttribute('data-test-tpk-prefab-bic-container');
assert.dom('.tpk-bic-container .tpk-bic-input').exists()
assert.dom('.tpk-bic-container .tpk-validation-errors').exists()
assert.dom('.tpk-bic-container .tpk-label').exists()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ module(
await settled();
assert.dom('[data-test-tpk-checkbox-input]').hasNoText();
assert
.dom('[data-test-tpk-checkbox]')
.dom('[data-test-tpk-prefab-checkbox-container]')
.hasAttribute('data-has-error', 'true');
});

test('CSS classes exist and have been attached to the correct element', async function (this: ThisTestContext,assert) {
const changeset = setupChangeset.call(this);
await renderComponent(changeset);
assert.dom('.tpk-checkbox-container').exists().hasAttribute('data-test-tpk-checkbox');
assert.dom('.tpk-checkbox-container').exists().hasAttribute('data-test-tpk-prefab-checkbox-container');
assert.dom('.tpk-checkbox-container .tpk-checkbox-input').exists()
assert.dom('.tpk-checkbox-container .tpk-validation-errors').exists()
assert.dom('.tpk-checkbox-container .tpk-label').exists()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ module(
await settled();
assert.dom('[data-test-tpk-email-input]').hasNoText();
assert
.dom('[data-test-tpk-email]')
.dom('[data-test-tpk-prefab-email-container]')
.hasAttribute('data-has-error', 'true');
});

test('CSS classes exist and have been attached to the correct element', async function (this: ThisTestContext,assert) {
const changeset = setupChangeset.call(this, 'email');
await renderComponent(changeset);
assert.dom('.tpk-email-container').exists().hasAttribute('data-test-tpk-email');
assert.dom('.tpk-email-container').exists().hasAttribute('data-test-tpk-prefab-email-container');
assert.dom('.tpk-email-container .tpk-email-input').exists()
assert.dom('.tpk-email-container .tpk-validation-errors').exists()
assert.dom('.tpk-email-container .tpk-label').exists()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module(
});
await settled();
assert.dom('[data-test-tpk-label]').containsText('label');
assert.dom('[data-test-tpk-file]').hasAttribute('data-has-error', 'true');
assert.dom('[data-test-tpk-prefab-file-container]').hasAttribute('data-has-error', 'true');

await triggerEvent('[data-test-tpk-file-input]', 'change', {
files: [new File(['Ember Rules!'], 'file.txt')],
Expand All @@ -56,7 +56,7 @@ module(
test('CSS classes exist and have been attached to the correct element', async function (this: ThisTestContext,assert) {
const changeset = setupChangeset.call(this);
await renderComponent(changeset);
assert.dom('.tpk-file-container').exists().hasAttribute('data-test-tpk-file');
assert.dom('.tpk-file-container').exists().hasAttribute('data-test-tpk-prefab-file-container');
assert.dom('.tpk-file-container .tpk-file-input').exists()
assert.dom('.tpk-file-container .tpk-validation-errors').exists()
assert.dom('.tpk-file-container .tpk-label').exists()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ module(
await settled();
assert.dom('.tpk-validation-errors span').hasText('required');
assert
.dom('[data-test-tpk-iban]')
.dom('[data-test-tpk-prefab-iban-container]')
.hasAttribute('data-has-error', 'true');
});

test('CSS classes exist and have been attached to the correct element', async function (this: ThisTestContext,assert) {
await renderComponentAndReturnChangeset.call(this);
assert.dom('.tpk-iban-container').exists().hasAttribute('data-test-tpk-iban');
assert.dom('.tpk-iban-container').exists().hasAttribute('data-test-tpk-prefab-iban-container');
assert.dom('.tpk-iban-container .tpk-iban-input').exists()
assert.dom('.tpk-iban-container .tpk-validation-errors').exists()
assert.dom('.tpk-iban-container .tpk-label').exists()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ module(
await settled();
assert.dom('[data-test-tpk-input-input]').hasNoText();
assert
.dom('[data-test-tpk-input]')
.dom('[data-test-tpk-prefab-input-container]')
.hasAttribute('data-has-error', 'true');
});

test('CSS classes exist and have been attached to the correct element', async function (this: ThisTestContext,assert) {
const changeset = setupChangeset.call(this);
await renderComponent(changeset);
assert.dom('.tpk-input-container').exists().hasAttribute('data-test-tpk-input');
assert.dom('.tpk-input-container').exists().hasAttribute('data-test-tpk-prefab-input-container');
assert.dom('.tpk-input-container .tpk-text-input').exists()
assert.dom('.tpk-input-container .tpk-validation-errors').exists()
assert.dom('.tpk-input-container .tpk-label').exists()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class TpkValidationBicPrefabComponent extends Component<TpkValida
as |V|>
<V.Label
class="tpk-bic-container"
data-test-tpk-bic
data-test-tpk-prefab-bic-container
data-has-error='{{V.hasError}}'
anchorScrollUp={{@validationField}}
...attributes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const TpkValidationCheckboxPrefabComponent: TOC<TpkValidationCheckboxPrefabSigna
@onChange={{@onChange}}
@requiredFields={{@requiredFields}}
as |V|>

<V.Label class="tpk-checkbox-container"
data-has-error='{{V.hasError}}'
anchorScrollUp={{@validationField}}
...attributes data-test-tpk-checkbox>
data-has-error='{{V.hasError}}'
anchorScrollUp={{@validationField}}
...attributes
data-test-tpk-prefab-checkbox-container>
<MandatoryLabelComponent
class="tpk-label"
@label={{@label}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const TpkValidationEmailPrefabComponent: TOC<TpkValidationEmailComponentSignatur
>
<V.Label
class="tpk-email-container"
data-test-tpk-email data-has-error='{{V.hasError}}'
data-test-tpk-prefab-email-container
data-has-error='{{V.hasError}}'
anchorScrollUp={{@validationField}}
...attributes>
<MandatoryLabelComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const TpkValidationFilePrefabComponent: TOC<TpkValidationFilePrefabSignature> =
<V.Label
class="tpk-file-container"
data-has-error="{{V.hasError}}"
data-test-tpk-file
data-test-tpk-prefab-file-container
...attributes>
<MandatoryLabelComponent
@label={{@label}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export default class TpkValidationIBANPrefabComponent extends Component<TpkValid
dispatch: getMaskForPrefixOrDefault,
};

get hasMaskNotDisabled() {
return this.args.disabled? '' : this.ibanMaskByCountry;
}


<template>
<TpkValidationInputComponent
Expand All @@ -65,14 +69,13 @@ export default class TpkValidationIBANPrefabComponent extends Component<TpkValid
@changeset={{@changeset}}
@mandatory={{@mandatory}}
@disabled={{@disabled}}
@mask={{this.ibanMaskByCountry}}
@mask={{this.hasMaskNotDisabled}}
@maskOptions={{this.maskOptions}}
@requiredFields={{@requiredFields}}

as |V|>
<V.Label
class="tpk-iban-container"
data-test-tpk-iban
data-test-tpk-prefab-iban-container
data-has-error='{{V.hasError}}'
anchorScrollUp={{@validationField}}
...attributes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class TpkValidationInputPrefabComponent extends Component<TpkVali
as |V|>
<V.Label
class="tpk-input-container"
data-test-tpk-input
data-test-tpk-prefab-input-container
data-has-error='{{V.hasError}}'
anchorScrollUp={{@validationField}}
...attributes>
Expand Down

0 comments on commit d275782

Please sign in to comment.