X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fvideo_embed_field%2Ftests%2Fsrc%2FFunctionalJavascript%2FLazyLoadFormatterTest.php;fp=web%2Fmodules%2Fcontrib%2Fvideo_embed_field%2Ftests%2Fsrc%2FFunctionalJavascript%2FLazyLoadFormatterTest.php;h=b7bc67342517a4e44edc619e007219cbe68e31ef;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/modules/contrib/video_embed_field/tests/src/FunctionalJavascript/LazyLoadFormatterTest.php b/web/modules/contrib/video_embed_field/tests/src/FunctionalJavascript/LazyLoadFormatterTest.php new file mode 100644 index 000000000..b7bc67342 --- /dev/null +++ b/web/modules/contrib/video_embed_field/tests/src/FunctionalJavascript/LazyLoadFormatterTest.php @@ -0,0 +1,50 @@ +setupEntityDisplays(); + } + + /** + * Test the lazy load formatter. + */ + public function testColorboxFormatter() { + $this->setDisplayComponentSettings('video_embed_field_lazyload', [ + 'autoplay' => TRUE, + 'responsive' => TRUE, + ]); + $node = $this->createVideoNode('https://example.com/mock_video'); + $this->drupalGet('node/' . $node->id()); + $this->click('.video-embed-field-lazy'); + $this->assertSession()->elementExists('css', '.video-embed-field-lazy .video-embed-field-responsive-video'); + // Make sure the right library files are loaded on the page. + $this->assertSession()->elementContains('css', 'style', 'video_embed_field/css/video_embed_field.responsive-video.css'); + } + +}