fix: clarify fixed CHRNX archive filters
This commit is contained in:
4 files changed
+160
-39
No files matched your search
@@ -208,7 +208,9 @@ class EditorialQueriesTest extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
$this->assertSame( 'code', $context['chrnx_topic'] );
|
||||
$this->assertMatchesRegularExpression( '/value="code"\s+selected=[\'\"]selected[\'\"]/', $output );
|
||||
$this->assertStringNotContainsString( '<select name="chrnx_topic">', $output );
|
||||
$this->assertMatchesRegularExpression( '/chrnx-journal-stream__fixed-filter[^>]*>.*Topic.*Code/s', $output );
|
||||
$this->assertStringContainsString( 'type="hidden" name="chrnx_topic" value="code"', $output );
|
||||
$this->assertStringContainsString( 'Code archive story', $output );
|
||||
$this->assertStringNotContainsString( 'Life archive story', $output );
|
||||
$this->assertStringContainsString( 'action="' . esc_url( get_term_link( $term ) ) . '"', $output );
|
||||
@@ -228,6 +230,19 @@ class EditorialQueriesTest extends WP_UnitTestCase {
|
||||
$query = chrnx_run_eligible_query( $args );
|
||||
$this->assertSame( 'es', $context['chrnx_language'] );
|
||||
$this->assertSame( array( $spanish ), array_map( 'absint', wp_list_pluck( $query->posts, 'ID' ) ) );
|
||||
$output = render_block(
|
||||
array(
|
||||
'blockName' => 'chrnx/journal-stream',
|
||||
'attrs' => array(),
|
||||
'innerBlocks' => array(),
|
||||
'innerHTML' => '',
|
||||
'innerContent' => array(),
|
||||
)
|
||||
);
|
||||
$this->assertStringNotContainsString( '<select name="chrnx_language">', $output );
|
||||
$this->assertStringNotContainsString( '>All languages<', $output );
|
||||
$this->assertStringContainsString( '<select name="chrnx_topic">', $output );
|
||||
$this->assertMatchesRegularExpression( '/chrnx-journal-stream__fixed-filter[^>]*>.*Language.*Español/s', $output );
|
||||
|
||||
$tag = self::factory()->tag->create_and_get( array( 'slug' => 'not-allowlisted' ) );
|
||||
$this->go_to( get_term_link( $tag ) );
|
||||
|
||||
Reference in new issue
Block a user