Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange test breaks #374

Open
SnarkBoojum opened this issue Dec 11, 2021 · 0 comments
Open

Strange test breaks #374

SnarkBoojum opened this issue Dec 11, 2021 · 0 comments

Comments

@SnarkBoojum
Copy link

I managed to build typestyle (see my other reports) but running the testsuite only works with a very bad-looking patch:

Description: make the tests pass (FIXME: looks bad)
Author: J.Puydt
Forwarded: yes

--- node-typestyle.orig/src/tests/basic.tsx
+++ node-typestyle/src/tests/basic.tsx
@@ -21,19 +21,19 @@
   it("child same", () => {
     reinit();
     style({ color: 'red', $nest: { '&>*': { color: 'red' } } });
-    assert.equal(getStyles(), '.f1nv0def,.f1nv0def>*{color:red}');
+    assert.equal(getStyles(), '.fxvpbc,.fxvpbc>*{color:red}');
   });
 
   it("child same unique", () => {
     reinit();
     style({ color: 'red', $nest: { '&>*': { color: 'red', $unique: true } } });
-    assert.equal(getStyles(), '.f1nv0def{color:red}.f1nv0def>*{color:red}');
+    assert.equal(getStyles(), '.fxvpbc{color:red}.fxvpbc>*{color:red}');
   });
 
   it("child different", () => {
     reinit();
     style({ color: 'red', $nest: { '&>*': { color: 'blue' } } });
-    assert.equal(getStyles(), '.fv84gyi{color:red}.fv84gyi>*{color:blue}');
+    assert.equal(getStyles(), '.f17jnn39{color:red}.f17jnn39>*{color:blue}');
   });
 
   it("media same", () => {
@@ -44,13 +44,13 @@
         '@media (min-width: 400px)': { color: 'red' }
       }
     });
-    assert.equal(getStyles(), '.f12z113b{color:red}@media (min-width: 400px){.f12z113b{color:red}}');
+    assert.equal(getStyles(), '.f7u1jp4{color:red}@media (min-width: 400px){.f7u1jp4{color:red}}');
   });
 
   it("media different", () => {
     reinit();
     style({ color: 'red', $nest: { '@media (min-width: 400px)': { color: 'blue' } } });
-    assert.equal(getStyles(), '.fxfrsga{color:red}@media (min-width: 400px){.fxfrsga{color:blue}}');
+    assert.equal(getStyles(), '.f13h18xh{color:red}@media (min-width: 400px){.f13h18xh{color:blue}}');
   });
 
   it("classes should compose", () => {
@@ -64,7 +64,7 @@
     reinit();
     cssRule('.transparent', { color: 'transparent' });
     style({ color: 'transparent' });
-    assert.equal(getStyles(), '.transparent,.fwarpl0{color:transparent}');
+    assert.equal(getStyles(), '.flez2cz .transparent{color:transparent}.fwarpl0{color:transparent}');
   });
 
   it("should support dedupe by default", () => {
@@ -83,7 +83,7 @@
         }
       }
     });
-    assert.equal(getStyles(), '.f13byakl{color:blue}.f13byakl::-webkit-input-placeholder,.f13byakl::-moz-placeholder,.f13byakl::-ms-input-placeholder{color:rgba(0, 0, 0, 0)}');
+    assert.equal(getStyles(), '.f1p4wti2{color:blue}.f1p4wti2::-webkit-input-placeholder,.f1p4wti2::-moz-placeholder,.f1p4wti2::-ms-input-placeholder{color:rgba(0, 0, 0, 0)}');
   });
 
   it("should support $unique", () => {
@@ -105,7 +105,7 @@
         }
       }
     });
-    assert.equal(getStyles(), '.f13byakl{color:blue}.f13byakl::-webkit-input-placeholder{color:rgba(0, 0, 0, 0)}.f13byakl::-moz-placeholder{color:rgba(0, 0, 0, 0)}.f13byakl::-ms-input-placeholder{color:rgba(0, 0, 0, 0)}');
+    assert.equal(getStyles(), '.f1p4wti2{color:blue}.f1p4wti2::-webkit-input-placeholder{color:rgba(0, 0, 0, 0)}.f1p4wti2::-moz-placeholder{color:rgba(0, 0, 0, 0)}.f1p4wti2::-ms-input-placeholder{color:rgba(0, 0, 0, 0)}');
   });
 
   it("should support $debugName", () => {
@@ -119,7 +119,7 @@
         }
       }
     });
-    assert.equal(getStyles(), '.sample_fy3xmhm{color:blue}.sample_fy3xmhm:hover{color:rgba(0, 0, 0, 0)}');
+    assert.equal(getStyles(), '.sample_fyguhj9{color:blue}.sample_fyguhj9:hover{color:rgba(0, 0, 0, 0)}');
   });
 
   it("should generate meaningful classnames using stylesheet", () => {
@@ -166,6 +166,6 @@
     const ts = createTypeStyle();
     ts.cssRule('body', { fontSize: 12 });
 
-    assert.equal(ts.getStyles(), 'body{font-size:12px}');
+    assert.equal(ts.getStyles(), '.f1vseg2o body{font-size:12px}');
   });
 })
--- node-typestyle.orig/src/tests/fontFace.tsx
+++ node-typestyle/src/tests/fontFace.tsx
@@ -11,7 +11,7 @@
       src: 'url("https://mdn.mozillademos.org/files/2468/VeraSeBd.ttf")'
     });
 
-    assert.equal(getStyles(), '@font-face{font-family:"Bitstream Vera Serif Bold";src:url("https://mdn.mozillademos.org/files/2468/VeraSeBd.ttf")}');
+    assert.equal(getStyles(), '@font-face{.f1l6a8dx{font-family:"Bitstream Vera Serif Bold";src:url("https://mdn.mozillademos.org/files/2468/VeraSeBd.ttf")}}');
   })
 
 });
--- node-typestyle.orig/src/tests/keyframes.ts
+++ node-typestyle/src/tests/keyframes.ts
@@ -10,7 +10,7 @@
         to: { opacity: 1 }
       });
 
-      assert.equal(animationName, 'fade-in_f1gwuh0p');
+      assert.equal(animationName, 'fu00fm1');
   });
 
   it('supports generated animation name', () => {
@@ -20,6 +20,6 @@
       to: { opacity: 1 }
     });
 
-    assert.equal(animationName, 'f1gwuh0p');
+    assert.equal(animationName, 'fu00fm1');
   });
 });
--- node-typestyle.orig/src/tests/media.ts
+++ node-typestyle/src/tests/media.ts
@@ -21,7 +21,7 @@
   it("support type", () => {
     reinit();
     style({ color: 'red' }, media({ minWidth: 400, type: 'screen' }, { color: 'red' }));
-    assert.equal(getStyles(), '.f1960l9c{color:red}@media screen and (min-width: 400px){.f1960l9c{color:red}}');
+    assert.equal(getStyles(), '.f1cm3m8v{color:red}@media screen and (min-width: 400px){.f1cm3m8v{color:red}}');
   });
 
   it("support $nest", () => {
@@ -36,7 +36,7 @@
           }
         }
       }));
-    assert.equal(getStyles(), '@media (min-width: 400px){.f1wrs385{color:red}.f1wrs385:hover{color:green}}');
+    assert.equal(getStyles(), '@media (min-width: 400px){.f1ehadqt{color:red}.f1ehadqt:hover{color:green}}');
   });
 
   it("support non-pixel min-width", () => {
@@ -48,7 +48,7 @@
     );
 
     cssRule('.component', mediaRules);
-    assert.equal(getStyles(), '@media (min-width: 20vh){.component{width:10vh}}');
+    assert.equal(getStyles(), '@media (min-width: 20vh){.f157c2hx .component{width:10vh}}');
   });
 
   it("support non-pixel max-width", () => {
@@ -60,7 +60,7 @@
     );
 
     cssRule('.component', mediaRules);
-    assert.equal(getStyles(), '@media (max-width: 20vh){.component{width:10vh}}');
+    assert.equal(getStyles(), '@media (max-width: 20vh){.fav0q63 .component{width:10vh}}');
   });
 
   it("support non-pixel min-height", () => {
@@ -72,7 +72,7 @@
     );
 
     cssRule('.component', mediaRules);
-    assert.equal(getStyles(), '@media (min-height: 20vh){.component{height:10vh}}');
+    assert.equal(getStyles(), '@media (min-height: 20vh){.fnbjckl .component{height:10vh}}');
   });
 
   it("support non-pixel max-height", () => {
@@ -84,7 +84,7 @@
     );
 
     cssRule('.component', mediaRules);
-    assert.equal(getStyles(), '@media (max-height: 20vh){.component{height:10vh}}');
+    assert.equal(getStyles(), '@media (max-height: 20vh){.f1v3bmt7 .component{height:10vh}}');
   });
 
   it("support orientation", () => {
@@ -96,6 +96,6 @@
     );
 
     cssRule('.component', mediaRules);
-    assert.equal(getStyles(), '@media (orientation: portrait){.component{color:red}}');
+    assert.equal(getStyles(), '@media (orientation: portrait){.fpoc6lq .component{color:red}}');
   });
 })
--- node-typestyle.orig/src/tests/rule.tsx
+++ node-typestyle/src/tests/rule.tsx
@@ -33,7 +33,7 @@
       color: colors.primary
     });
 
-    assert.equal(getStyles(), 'html{height:100%}body{background-color:white;color:blue;font-size:14pt;height:100%;margin:0;padding:0}');
+    assert.equal(getStyles(), '.fka7rhy html{height:100%}.f7j7bg5 body{background-color:white;color:blue;font-size:14pt;height:100%;margin:0;padding:0}');
   });
 
   it("support application style layout", () => {
@@ -55,7 +55,7 @@
       boxSizing: 'inherit',
     });
 
-    assert.equal(getStyles(), 'html, body{height:100%;margin:0;padding:0;width:100%}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}');
+    assert.equal(getStyles(), '.f138qpw6 html, body{height:100%;margin:0;padding:0;width:100%}.ftl7rip html{box-sizing:border-box}.frr8itm *,*:before,*:after{box-sizing:inherit}');
   });
 
   it('support global media queries', () => {
@@ -68,6 +68,6 @@
         }
       }
     });
-    assert.equal(getStyles(), '@media print{body{background:white}}');
+    assert.equal(getStyles(), '@media print{.f5tticz body{background:white}}');
   });
 });
--- node-typestyle.orig/src/tests/supports.ts
+++ node-typestyle/src/tests/supports.ts
@@ -12,6 +12,6 @@
         }
       }
     });
-    assert.equal(getStyles(), '.f5f13tn{color:red}@supports (display: flex){.f5f13tn{color:white}}');
+    assert.equal(getStyles(), '.f1u5z8ro{color:red}@supports (display: flex){.f1u5z8ro{color:white}}');
   });
 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant