Skip to content

Commit

Permalink
Rework tests
Browse files Browse the repository at this point in the history
  • Loading branch information
david-szabo97 committed Apr 6, 2021
1 parent 9ad0c28 commit f482414
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions packages/e2e-tests/specs/editor/various/allowed-patterns.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ const isPatternAvailable = async ( name ) => {
};

const TEST_PATTERNS = [
[ 'Test: Single heading', false ],
[ 'Test: Single paragraph', true ],
[ 'Test: Paragraph inside group', true ],
[ 'Test: Single heading', true ],
[ 'Test: Single paragraph', false ],
[ 'Test: Paragraph inside group', false ],
];

describe( 'Allowed Patterns', () => {
Expand All @@ -37,11 +37,11 @@ describe( 'Allowed Patterns', () => {
} );

describe( 'Disable blocks plugin disabled', () => {
it( 'should show test patterns', async () => {
for ( const [ patternName ] of TEST_PATTERNS ) {
for ( const [ patternName ] of TEST_PATTERNS ) {
it( `should show test pattern "${ patternName }"`, async () => {
expect( await isPatternAvailable( patternName ) ).toBe( true );
}
} );
} );
}
} );

describe( 'Disable blocks plugin enabled', () => {
Expand All @@ -56,12 +56,14 @@ describe( 'Allowed Patterns', () => {
);
} );

it( 'should not show test patterns', async () => {
for ( const [ patternName, shouldBeAvailable ] of TEST_PATTERNS ) {
for ( const [ patternName, shouldBeAvailable ] of TEST_PATTERNS ) {
it( `should${
shouldBeAvailable ? '' : ' not'
} show test "pattern ${ patternName }"`, async () => {
expect( await isPatternAvailable( patternName ) ).toBe(
shouldBeAvailable
);
}
} );
} );
}
} );
} );

0 comments on commit f482414

Please sign in to comment.