Skip to content
Permalink
Browse files

Conditionally run height/width in iframeTest

  • Loading branch information
rwaldron committed Jun 6, 2012
1 parent 53a5810 commit 5d25f78291c11ca26ce70281ee4ac81d1e3d8dd4
Showing with 7 additions and 2 deletions.
  1. +7 −2 test/unit/dimensions.js
@@ -430,8 +430,13 @@ testIframe( "dimensions/documentSmall", "window vs. small document", function( j
testIframe( "dimensions/documentLarge", "window vs. large document", function( jQuery, window, document ) {
expect(2);

ok( jQuery( document ).height() > jQuery( window ).height(), "document height is larger than window height" );
ok( jQuery( document ).width() > jQuery( window ).width(), "document width is larger than window width" );
if ( jQuery.fn.height && jQuery.fn. width ) {

This comment has been minimized.

Copy link
@staabm

staabm Jun 7, 2012

Contributor

Space in front of width

This comment has been minimized.

Copy link
@rwaldron

rwaldron Jun 7, 2012

Author Member

Please be sure to review the latest version of the code before providing review contributions - this has already been fixed (ie. removed)

expect(2);
ok( jQuery( document ).height() > jQuery( window ).height(), "document height is larger than window height" );
ok( jQuery( document ).width() > jQuery( window ).width(), "document width is larger than window width" );
} else {
expect(0);
}
});

}

14 comments on commit 5d25f78

@Krinkle

This comment has been minimized.

Copy link
Member

@Krinkle Krinkle replied Jun 6, 2012

0 tests is considered a failure by TestSwarm. Also there is another expect(2); higher in the function. Is there some context behind this?

@rwaldron

This comment has been minimized.

Copy link
Member Author

@rwaldron rwaldron replied Jun 6, 2012

The context is that if dimensions isn't built (it's now conditional), then height and width functions are defined.

@Krinkle

This comment has been minimized.

Copy link
Member

@Krinkle Krinkle replied Jun 6, 2012

Thanks, I missed that new feature. Awesome.

@mikesherov

This comment has been minimized.

Copy link
Member

@mikesherov mikesherov replied Jun 7, 2012

I'm not sure I understand this commit. Why does this matter if the whole module is wrapped in this same conditional you've added?

@rwaldron

This comment has been minimized.

Copy link
Member Author

@rwaldron rwaldron replied Jun 7, 2012

Don't know what to tell you... There were errors, this fixed it. I say we just move on, shall we?

@mikesherov

This comment has been minimized.

Copy link
Member

@mikesherov mikesherov replied Jun 7, 2012

Yeah, I'd love to move on, but this indicates that I can't reliably test locally, because those conditionals weren't necessary locally, nor do they really make any sense, unless I don't know how testswarm works.

@dmethvin

This comment has been minimized.

Copy link
Member

@dmethvin dmethvin replied Jun 7, 2012

@rwldrn was that failing for you locally? I'm not sure why you'd need to have another guard test but maybe it was a caching issue.

@rwaldron

This comment has been minimized.

Copy link
Member Author

@rwaldron rwaldron replied Jun 7, 2012

Locally, yes. No cache, I test in incognito mode with cache off and double down with cache busted URLs.

@rwaldron

This comment has been minimized.

Copy link
Member Author

@rwaldron rwaldron replied Jun 7, 2012

I just figured it had something to do with running in an iframe.

@mikesherov

This comment has been minimized.

Copy link
Member

@mikesherov mikesherov replied Jun 7, 2012

Just admit that this commit makes no sense and we can move on :-)

@rwaldron

This comment has been minimized.

Copy link
Member Author

@rwaldron rwaldron replied Jun 7, 2012

There is a typo, I'll admit that.

@rwaldron

This comment has been minimized.

Copy link
Member Author

@rwaldron rwaldron replied Jun 7, 2012

We may never know why I saw what I saw, but it is no more. Fresh build -dimensions, no issues now...

@Krinkle

This comment has been minimized.

Copy link
Member

@Krinkle Krinkle replied Jun 7, 2012

@mikesherov The conditional has no relation to testswarm. The issue with testswarm is the expect(0);. If a test should not be run, then conditionally run the test instead of just its assertions. If a test has 0 assertions, it is considered a failure.

@rwaldron

This comment has been minimized.

Copy link
Member Author

@rwaldron rwaldron replied Jun 7, 2012

@Krinkle have we figured out a way to test optional module builds? The expect(0) code can only be reached if jQuery was built with: grunt build:*:*:-dimensions

Please sign in to comment.
You can’t perform that action at this time.