Skip to content

Commit

Permalink
Fix Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
widoz committed Jul 20, 2024
1 parent 334de60 commit 971910e
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
exports[`Preset Entities By Kind Should render the CompositeEntitiesByKind component with the appropriate configuration 1`] = `
<DocumentFragment>
<div
class="wes-preset-entities-by-kind extra-class-name"
class="kensaku-preset-entities-by-kind extra-class-name"
>
<div>
KindComponent
</div>
<div
class="wes-search-control"
class="kensaku-search-control"
>
<label
for=":r0:"
>
<span
class="wes-search-control__label"
class="kensaku-search-control__label"
>
Search
</span>
<input
class="wes-search-control__input"
class="kensaku-search-control__input"
id=":r0:"
type="search"
value=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe( 'CompositeEntitiesByKind', () => {
);

const kindSelect = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

await userEvent.selectOptions( kindSelect, 'page' );
Expand Down Expand Up @@ -106,7 +106,7 @@ describe( 'CompositeEntitiesByKind', () => {
);

const entitiesSelect = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

await userEvent.selectOptions( entitiesSelect, [ 'post-2' ] );
Expand Down Expand Up @@ -160,10 +160,10 @@ describe( 'CompositeEntitiesByKind', () => {
);

const kindSelect = rendered.container.querySelector(
'.wes-select-control--singular'
'.kensaku-select-control--singular'
) as HTMLSelectElement;
const entitiesSelect = rendered.container.querySelector(
'.wes-select-control--plural'
'.kensaku-select-control--plural'
) as HTMLSelectElement;

await userEvent.selectOptions( entitiesSelect, [ 'post-2' ] );
Expand Down Expand Up @@ -230,7 +230,7 @@ describe( 'CompositeEntitiesByKind', () => {
);

const kindSelect = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

expect( expectedEntities.length() ).toBe( 2 );
Expand Down Expand Up @@ -298,7 +298,7 @@ describe( 'CompositeEntitiesByKind', () => {
);

const kindSelect = rendered.container.querySelector(
'.wes-select-control--singular'
'.kensaku-select-control--singular'
) as HTMLSelectElement;

await userEvent.selectOptions( kindSelect, 'page' );
Expand Down Expand Up @@ -345,7 +345,7 @@ describe( 'CompositeEntitiesByKind', () => {
);

const entitiesSelect = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

expect( selectedEntities.length() ).toBe( 2 );
Expand Down Expand Up @@ -464,7 +464,7 @@ describe( 'CompositeEntitiesByKind', () => {
);

const entitiesSelect = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

await userEvent.selectOptions( entitiesSelect, [ 'post-1' ] );
Expand Down Expand Up @@ -503,7 +503,7 @@ describe( 'CompositeEntitiesByKind', () => {
);

const postTypeSelect = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

await userEvent.deselectOptions( postTypeSelect, [ 'post' ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe( 'Preset Entities By Kind', () => {

const kindComponent = screen.getByTestId( 'kind-component' );
const firstComponent = rendered.container.querySelector(
'.wes-preset-entities-by-kind'
'.kensaku-preset-entities-by-kind'
);

expect( kindComponent === firstComponent?.firstElementChild ).toEqual(
Expand Down Expand Up @@ -101,7 +101,7 @@ describe( 'Preset Entities By Kind', () => {

const kindComponent = screen.getByTestId( 'entities-component' );
const firstComponent = rendered.container.querySelector(
'.wes-preset-entities-by-kind'
'.kensaku-preset-entities-by-kind'
);

expect( kindComponent === firstComponent?.lastElementChild ).toEqual(
Expand Down Expand Up @@ -137,7 +137,7 @@ describe( 'Preset Entities By Kind', () => {

expect(
rendered.container
.querySelector( '.wes-preset-entities-by-kind' )
.querySelector( '.kensaku-preset-entities-by-kind' )
?.classList.contains( 'extra-class' )
).toEqual( true );
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Posts Select Render the NoOptionsMessage component 1`] = `
<DocumentFragment>
<p
class="wes-no-option-message"
class="kensaku-no-option-message"
>
No options
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`KindRadioControl renders the NoOptionsMessage when there are no options 1`] = `
<div
class="test-class wes-radio-control"
class="test-class kensaku-radio-control"
/>
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`SearchControl renders the input outside the label if the id prop is not passed 1`] = `
<input
class="wes-search-control__input"
class="kensaku-search-control__input"
id=":r1:"
type="search"
value=""
Expand All @@ -11,7 +11,7 @@ exports[`SearchControl renders the input outside the label if the id prop is not

exports[`SearchControl renders the input within the label if the id prop is passed 1`] = `
<input
class="wes-search-control__input"
class="kensaku-search-control__input"
id="search"
type="search"
value=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

exports[`EntitiesToggleControl renders correctly 1`] = `
<div
class="test-class wes-toggle-control"
class="test-class kensaku-toggle-control"
>
<div
class="wes-toggle-control-item wes-toggle-control-item--1"
class="kensaku-toggle-control-item kensaku-toggle-control-item--1"
>
<label
for=":r0:"
>
<input
checked=""
class="wes-toggle-control-item__input-1"
class="kensaku-toggle-control-item__input-1"
id=":r0:"
type="checkbox"
value="1"
Expand All @@ -21,13 +21,13 @@ exports[`EntitiesToggleControl renders correctly 1`] = `
</label>
</div>
<div
class="wes-toggle-control-item wes-toggle-control-item--2"
class="kensaku-toggle-control-item kensaku-toggle-control-item--2"
>
<label
for=":r1:"
>
<input
class="wes-toggle-control-item__input-2"
class="kensaku-toggle-control-item__input-2"
id=":r1:"
type="checkbox"
value="2"
Expand All @@ -36,13 +36,13 @@ exports[`EntitiesToggleControl renders correctly 1`] = `
</label>
</div>
<div
class="wes-toggle-control-item wes-toggle-control-item--3"
class="kensaku-toggle-control-item kensaku-toggle-control-item--3"
>
<label
for=":r2:"
>
<input
class="wes-toggle-control-item__input-3"
class="kensaku-toggle-control-item__input-3"
id=":r2:"
type="checkbox"
value="3"
Expand All @@ -55,7 +55,7 @@ exports[`EntitiesToggleControl renders correctly 1`] = `

exports[`EntitiesToggleControl renders the NoOptionsMessage when there are no options 1`] = `
<p
class="wes-no-option-message"
class="kensaku-no-option-message"
>
No options
</p>
Expand Down
4 changes: 2 additions & 2 deletions tests/client/unit/components/plural-select-control.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe( 'Posts Select', () => {
String( options.last()?.value ),
];
const select = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

/*
Expand Down Expand Up @@ -80,7 +80,7 @@ describe( 'Posts Select', () => {
String( options.last()?.value ),
];
const select = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

/*
Expand Down
8 changes: 4 additions & 4 deletions tests/client/unit/components/singular-select-control.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe( 'Post Types Select', () => {
);

const select = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

userEvent.selectOptions( select, option.value ).then( () => {
Expand All @@ -61,7 +61,7 @@ describe( 'Post Types Select', () => {
);

expect(
rendered.container.querySelector( '.wes-no-option-message' )
rendered.container.querySelector( '.kensaku-no-option-message' )
).toBeInTheDocument();
} );

Expand All @@ -83,11 +83,11 @@ describe( 'Post Types Select', () => {
const rendered = render( <SingularSelectControl { ...props } /> );

const select = rendered.container.querySelector(
'.wes-select-control'
'.kensaku-select-control'
) as HTMLSelectElement;

const option = select.querySelector(
'.wes-select-control-item--option-one'
'.kensaku-select-control-item--option-one'
) as HTMLOptionElement;
option.value = 'option-3';

Expand Down
2 changes: 1 addition & 1 deletion tests/client/unit/components/toggle-control.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe( 'EntitiesToggleControl', () => {
const rendered = render( <ToggleControl { ...props } /> );

const option = rendered.container.querySelector(
'.wes-toggle-control-item__input-option-one'
'.kensaku-toggle-control-item__input-option-one'
) as HTMLOptionElement;
option.value = 'option-3';

Expand Down

0 comments on commit 971910e

Please sign in to comment.