Skip to content

Commit

Permalink
Revert "added test cases"
Browse files Browse the repository at this point in the history
This reverts commit a1f8667.
  • Loading branch information
sharath-kannan committed Jan 8, 2025
1 parent a1f8667 commit 4966fc7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 256 deletions.
2 changes: 1 addition & 1 deletion libs/blocks/table/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function defineDeviceByScreenSize() {
return 'TABLET';
}

export function isStickyHeader(el) {
function isStickyHeader(el) {
return el.classList.contains('sticky')
|| (el.classList.contains('sticky-desktop-up') && defineDeviceByScreenSize() === 'DESKTOP')
|| (el.classList.contains('sticky-tablet-up') && defineDeviceByScreenSize() !== 'MOBILE' && !isMobileLandscape());
Expand Down
247 changes: 0 additions & 247 deletions test/blocks/table/mocks/body.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,253 +247,6 @@
<div data-align="center"></div>
</div>
</div>
<div class="table highlight collapse sticky-tablet-up">
<div>
<div></div>
<div></div>
<div>Ee kj oyo kug it oi ooy o Bbibibi</div>
<div><strong>e</strong></div>
<div></div>
</div>
<div>
<div></div>
<div>Test1</div>
<div>
<p>Adobe Standard2</p>
<p>US$19.99/mo</p>
<p><em><a href="https://www.figma.com/file/tZXvTXkgnUe1RSzVAsZyW5/Tables-Design-Sprint?node-id=405-792&amp;t=C8MMN1R7uykmb6Nt-0">Free trial</a></em></p>
<p><strong><a href="https://www.figma.com/file/tZXvTXkgnUe1RSzVAsZyW5/Tables-Design-Sprint?node-id=405-792&amp;t=C8MMN1R7uykmb6Nt-0">Buy now</a></strong></p>
</div>
<div>
<p>Adobe Standard3</p>
<p>US$19.99/mo</p>
<p><em><a href="https://www.figma.com/file/tZXvTXkgnUe1RSzVAsZyW5/Tables-Design-Sprint?node-id=405-792&amp;t=C8MMN1R7uykmb6Nt-0">Free trial</a></em></p>
<p><strong><a href="https://www.figma.com/file/tZXvTXkgnUe1RSzVAsZyW5/Tables-Design-Sprint?node-id=405-792&amp;t=C8MMN1R7uykmb6Nt-0">Buy now</a></strong></p>
</div>
<div>
<p>Adobe Standard4</p>
<p>US$19.99/mo</p>
<p><em><a href="https://www.figma.com/file/tZXvTXkgnUe1RSzVAsZyW5/Tables-Design-Sprint?node-id=405-792&amp;t=C8MMN1R7uykmb6Nt-0">Free trial</a></em></p>
<p><strong><a href="https://www.figma.com/file/tZXvTXkgnUe1RSzVAsZyW5/Tables-Design-Sprint?node-id=405-792&amp;t=C8MMN1R7uykmb6Nt-0">Buy now</a></strong></p>
</div>
</div>
<div>
<div data-align="center">
<hr>
</div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
</div>
<div>
<div data-align="center"><strong>E-signature core features signat core features</strong></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
</div>
<div>
<div class="tooltip-heading">Right <strong>bold</strong> and <a href="#">Link</a><span class="icon icon-tooltip"></span></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div class="multi-content-heading">Sign agreements <strong>bold</strong> and <a href="#">Link</a></div>
<div data-align="center"></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div></div>
</div>
<div>
<div>
<p>Track and manage agreements</p>
<p><span class="icon icon-info"></span></p>
</div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>
<p>Add a business stamp</p>
<p><span class="icon icon-info"></span></p>
</div>
<div></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>
<p>Prepare forms</p>
<p><span class="icon icon-info"></span></p>
</div>
<div></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div data-align="center">
<hr>
</div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
</div>
<div>
<div data-align="center"><strong>Interact with PDFs</strong></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
</div>
<div>
<div>Collect signatures</div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>Sign agreements</div>
<div data-align="center"></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div></div>
</div>
<div>
<div>Track and manage agreements</div>
<div data-align="center"></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>Add a business stamp</div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>Prepare forms</div>
<div></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div data-align="center">
<hr>
</div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
</div>
<div>
<div data-align="center"><strong>E-signature core features</strong></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
</div>
<div>
<div>Collect signatures</div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>Sign agreements</div>
<div data-align="center"></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div></div>
</div>
<div>
<div>
<p>Track and manage agreements</p>
<p><span class="icon icon-info"></span></p>
</div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>Add a business stamp</div>
<div></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>Prepare forms</div>
<div></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div data-align="center">
<hr>
</div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
</div>
<div>
<div data-align="center"><strong>Interact with PDFs</strong></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
<div data-align="center"></div>
</div>
<div>
<div>Collect signatures</div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>Sign agreements</div>
<div data-align="center"></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div></div>
</div>
<div>
<div>Track and manage agreements</div>
<div data-align="center"></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>Add a business stamp</div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
<div>
<div>Prepare forms</div>
<div></div>
<div></div>
<div data-align="center"><span class="icon icon-checkmark"></span></div>
<div data-align="center"></div>
</div>
</div>
<div class="table-metadata">
<div>
<div>Highlight color</div>
Expand Down
9 changes: 1 addition & 8 deletions test/blocks/table/table.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MILO_EVENTS } from '../../../libs/utils/utils.js';
import { delay, waitForElement } from '../../helpers/waitfor.js';

document.body.innerHTML = await readFile({ path: './mocks/body.html' });
const { default: init, isStickyHeader } = await import('../../../libs/blocks/table/table.js');
const { default: init } = await import('../../../libs/blocks/table/table.js');

describe('table and tablemetadata', () => {
beforeEach(() => {
Expand Down Expand Up @@ -111,12 +111,5 @@ describe('table and tablemetadata', () => {
expect(tooltipHeading.childNodes.length).to.equal(2);
expect(tooltipHeading.querySelector('.milo-tooltip, .icon-tooltip')).to.exist;
});

it('verifies if sticky tablet-up is disabled in mobile', () => {
const stickyTable = document.querySelector('.sticky-tablet-up');
window.innerWidth = 1200;
window.dispatchEvent(new Event('resize'));
expect(isStickyHeader(stickyTable)).to.false;
});
});
});

0 comments on commit 4966fc7

Please sign in to comment.