Skip to content

Commit

Permalink
chore(core): update tests after changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Grsmto committed Jan 19, 2023
1 parent 48b30dc commit 0208be1
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions packages/simplebar-core/tests/simplebar.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
import SimpleBar from '../src';

const template = `<div class="simplebar-wrapper">
<div class="simplebar-height-auto-observer-wrapper">
<div class="simplebar-height-auto-observer"></div>
</div>
<div class="simplebar-mask">
<div class="simplebar-offset">
<div class="simplebar-content-wrapper" tabIndex="0" role="region" [ariaLabel]="ariaLabel">
<div class="simplebar-content"></div>
</div>
</div>
</div>
<div class="simplebar-placeholder"></div>
</div>
<div class="simplebar-track simplebar-horizontal">
<div class="simplebar-scrollbar"></div>
</div>
<div class="simplebar-track simplebar-vertical">
<div class="simplebar-scrollbar"></div>
</div>`;

beforeEach(() => {
jest.resetModules();

// Set up our document body
document.body.innerHTML =
'<div id="simplebar" data-simplebar-force-visible="true"></div>';
document.body.innerHTML = `<div id="simplebar" data-simplebar="init" data-simplebar-force-visible="true">${template}</div>`;
});

test('should call constructor', () => {
Expand Down Expand Up @@ -120,8 +139,7 @@ describe('nested SimpleBars with initiated DOM', () => {

beforeEach(() => {
// Set up our document body
document.body.innerHTML =
'<div id="simplebar-parent"><div id="simplebar-child"></div></div>';
document.body.innerHTML = `<div id="simplebar-parent">${template}<div id="simplebar-child">${template}</div></div>`;

parent = new SimpleBar(
document.getElementById('simplebar-parent') as HTMLElement
Expand Down

0 comments on commit 0208be1

Please sign in to comment.