| Server IP : 14.225.204.176 / Your IP : 216.73.216.252 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/langngon.com/wp-content/plugins/wordpress-seo/js/tests/ |
Upload File : |
import shortCodePlugin from "../src/wp-seo-shortcode-plugin";
const { YoastShortcodePlugin } = window;
const { removeUnknownShortCodes } = YoastShortcodePlugin.prototype;
describe( 'removeUnknownShortcodes', () => {
it( 'filters undefined shortcodes', () => {
const input = "[shortcode]Hello[/shortcode]";
const expected = "Hello";
const actual = removeUnknownShortCodes( input );
expect( actual ).toBe( expected );
} );
it( 'filters shortcodes with special characters', () => {
const input = '<p>[vc_row][vc_column][vc_column_text css_animation="bounceInLeft" el_class="tøüst123" css=".vc_custom_1482153765626{margin-right: 4px !important;border-right-width: 2px !important;padding-right: 1px !important;background-color: #777777 !important;border-right-style: dashed !important;border-radius: 10px !important;}"]I am text blöck. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.[/vc_column_text][/vc_column][/vc_row]</p>';
const expected = "<p>I am text blöck. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.</p>";
const actual = removeUnknownShortCodes( input );
expect( actual ).toBe( expected );
} );
});