Skip to content

Commit 7349508

Browse files
committed
test(calendar): refine vertical orientation test to validate part inclusion
1 parent 34a5935 commit 7349508

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/components/calendar/calendar-rendering.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,16 @@ describe('Calendar Rendering', () => {
140140
expect(last.children.item(6)?.part.contains('hidden')).to.be.true;
141141
});
142142

143-
it('should change orientation', async () => {
143+
it('should set vertical orientation part', async () => {
144144
calendar.orientation = 'vertical';
145145
await elementUpdated(calendar);
146146

147-
const verticalContent = calendar.shadowRoot?.querySelector(
148-
'[part=content-vertical]'
149-
);
150-
expect(verticalContent).to.exist;
147+
const contentEl = calendar.shadowRoot?.querySelector('[part~="content"]');
148+
expect(contentEl).to.exist;
149+
150+
const partAttr = contentEl?.getAttribute('part') || '';
151+
const parts = partAttr.split(/\s+/);
152+
expect(parts).to.include('content-vertical');
151153
});
152154

153155
it('successfully enables and disables `hideHeader`', async () => {

0 commit comments

Comments
 (0)