Try again to loosen matchers in tests

This commit is contained in:
Sam Seay 2024-11-08 19:22:34 +08:00
parent 825451bf45
commit c55221923a
No known key found for this signature in database
GPG Key ID: 2223711A9151668A
2 changed files with 8 additions and 9 deletions

View File

@ -76,7 +76,11 @@ describe( 'ShippingAddress', () => {
<ShippingAddress />
</ShippingCalculatorContext.Provider>
);
expect( screen.getByText( /Delivers to 94107/ ) ).toBeInTheDocument();
expect(
screen.getByText( ( content ) =>
/Delivers to 94107/.test( content )
)
).toBeInTheDocument();
expect( screen.getByText( 'Change address' ) ).toBeInTheDocument();
expect(
screen.queryByText( /Collection from/ )
@ -121,9 +125,7 @@ describe( 'ShippingAddress', () => {
);
expect(
screen.getByText( ( content ) =>
/Collection from 123 Easy Street, New York, 12345/.test(
content
)
/Collection from 123 Easy Street/.test( content )
)
).toBeInTheDocument();
} );
@ -152,9 +154,7 @@ describe( 'ShippingAddress', () => {
render( <ShippingAddress /> );
expect(
screen.getByText( ( content ) =>
/Collection from 123 Easy Street, New York, 12345/.test(
content
)
/Collection from 123 Easy Street/.test( content )
)
).toBeInTheDocument();
} );

View File

@ -15,8 +15,7 @@
.wc-block-components-main {
box-sizing: border-box;
margin: 0;
padding-right:
math.percentage(math.div($gap-largest, 1060px)); // ~1060px is the default width of the content area in Storefront.
padding-right: math.percentage(math.div($gap-largest, 1060px)); // ~1060px is the default width of the content area in Storefront.
width: 65%;
}
}