mirror of
https://github.com/outline/outline.git
synced 2026-11-26 07:33:19 +03:00
test
This commit is contained in:
1 parent
e69935be99
commit
316520dbb0
2 files changed
+5
-1
No files matched your search
@@ -19,6 +19,10 @@ describe("YouTube", () => {
|
||||
expect("https://youtu.be/dQw4w9WgXcQ".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test("to be enabled on shortlink with timestamp", () => {
|
||||
expect("https://youtu.be/dQw4w9WgXcQ?t=123".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://youtu.be".match(match)).toBe(null);
|
||||
expect("https://youtube.com".match(match)).toBe(null);
|
||||
|
||||
@@ -19,7 +19,7 @@ function YouTube(props: Props) {
|
||||
}
|
||||
|
||||
YouTube.ENABLED = [
|
||||
/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})(?:\?)?(.*)?$/i,
|
||||
/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})(?:\?(.*))?$/i,
|
||||
];
|
||||
|
||||
export default YouTube;
|
||||
Reference in new issue
Block a user