Browse Source

fix test and comment

Yuki Takei 9 months ago
parent
commit
2856b41487

+ 1 - 1
apps/app/src/components/Script/DrawioViewerScript/DrawioViewerScript.tsx

@@ -19,7 +19,7 @@ export const DrawioViewerScript = ({ drawioUri }: Props): JSX.Element => {
 
   const loadedHandler = useCallback(() => {
     // disable useResizeSensor and checkVisibleState
-    //   for preventing resize event by viewer.min.js
+    //   for preventing resize event by viewer-static.min.js
     GraphViewer.useResizeSensor = false;
     GraphViewer.prototype.checkVisibleState = false;
 

+ 4 - 4
apps/app/src/components/Script/DrawioViewerScript/use-viewer-min-js-url.spec.ts

@@ -3,10 +3,10 @@ import { useViewerMinJsUrl } from './use-viewer-min-js-url';
 describe('useViewerMinJsUrl', () => {
   it.each`
     drawioUri                                     | expected
-    ${'http://localhost:8080'}                    | ${'http://localhost:8080/js/viewer.min.js'}
-    ${'http://example.com'}                       | ${'http://example.com/js/viewer.min.js'}
-    ${'http://example.com/drawio'}                | ${'http://example.com/drawio/js/viewer.min.js'}
-    ${'http://example.com/?offline=1&https=0'}    | ${'http://example.com/js/viewer.min.js?offline=1&https=0'}
+    ${'http://localhost:8080'}                    | ${'http://localhost:8080/js/viewer-static.min.js'}
+    ${'http://example.com'}                       | ${'http://example.com/js/viewer-static.min.js'}
+    ${'http://example.com/drawio'}                | ${'http://example.com/drawio/js/viewer-static.min.js'}
+    ${'http://example.com/?offline=1&https=0'}    | ${'http://example.com/js/viewer-static.min.js?offline=1&https=0'}
   `('should return the expected URL "$expected" when drawioUri is "$drawioUrk"', ({ drawioUri, expected }: {drawioUri: string, expected: string}) => {
     // Act
     const url = useViewerMinJsUrl(drawioUri);