Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
try: not using beforeEeach
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhtungdu committed Dec 29, 2022
1 parent cf8fb22 commit 7259f2d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/e2e/specs/backend/product-query/popular-filters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,21 @@ describeOrSkip( GUTENBERG_EDITOR_CONTEXT === 'gutenberg' )(
} );

describe( 'Best Selling', () => {
beforeEach( async () => {
it( 'Editor preview and block frontend display the same products', async () => {
await selectPopularFilterPreset(
$popularFiltersPanel,
'Best Selling'
);
} );
it( 'Editor preview and block frontend display the same products', async () => {
const { previewProducts, frontEndProducts } =
await setupEditorFrontendComparison();
expect( frontEndProducts ).toEqual( previewProducts );
} );

it( 'Products are displayed in the correct order', async () => {
await selectPopularFilterPreset(
$popularFiltersPanel,
'Best Selling'
);
const { productQueryProducts, shortcodeProducts } =
await setupProductQueryShortcodeComparison(
'[products best_selling="true" limit="9"]'
Expand All @@ -126,19 +128,21 @@ describeOrSkip( GUTENBERG_EDITOR_CONTEXT === 'gutenberg' )(
} );

describe( 'Top Rated', () => {
beforeEach( async () => {
it( 'Editor preview and block frontend display the same products', async () => {
await selectPopularFilterPreset(
$popularFiltersPanel,
'Top Rated'
);
} );
it( 'Editor preview and block frontend display the same products', async () => {
const { previewProducts, frontEndProducts } =
await setupEditorFrontendComparison();
expect( frontEndProducts ).toEqual( previewProducts );
} );

it( 'Products are displayed in the correct order', async () => {
await selectPopularFilterPreset(
$popularFiltersPanel,
'Top Rated'
);
const { productQueryProducts, shortcodeProducts } =
await setupProductQueryShortcodeComparison(
'[products top_rated="true" limit="9"]'
Expand Down

0 comments on commit 7259f2d

Please sign in to comment.