Skip to content

Commit

Permalink
More tests!
Browse files Browse the repository at this point in the history
  • Loading branch information
pento committed Mar 1, 2016
1 parent 1907ae3 commit 7110f56
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/test-frontend.php
Expand Up @@ -47,4 +47,31 @@ function test_content_not_changed_outside_loop() {

$this->assertEquals( $content, $react->the_content( $content ) );
}

/**
* Test that the emoji.json URL is passed.
*/
function test_json_url_is_passed() {
$post_id = $this->factory->post->create();

$this->go_to( get_permalink( $post_id ) );

ob_start();
wp_head();
$head = ob_get_clean();

$this->assertEquals( 1, preg_match( "/emoji_url: '[^']*emoji.json'/", $head ) );
}

function test_selector_in_footer() {
$post_id = $this->factory->post->create();

$this->go_to( get_permalink( $post_id ) );

ob_start();
wp_footer();
$footer = ob_get_clean();

$this->assertGreaterThanOrEqual( 0, strpos( '<div class="emoji-reaction-selector"', $footer ) );
}
}

0 comments on commit 7110f56

Please sign in to comment.