Skip to content

Commit 09ed1e4

Browse files
committed
test(update): fix tests
1 parent 714d921 commit 09ed1e4

File tree

2 files changed

+32
-60
lines changed

2 files changed

+32
-60
lines changed

test/contentHeadline.test.js

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,34 @@ describe('contentHeadline', () => {
1414
const root = defineComponent({
1515
components: { ContentContainer, ContentHeadline: DebugContentHeadline },
1616
template: `
17+
<ContentContainer>
18+
<ContentContainer>
19+
<ContentHeadline />
1720
<ContentContainer>
1821
<ContentHeadline />
22+
<ContentContainer>
23+
<ContentHeadline />
1924
<ContentContainer>
25+
<ContentHeadline />
2026
<ContentContainer>
2127
<ContentHeadline />
2228
<ContentContainer>
23-
<ContentContainer>
24-
<ContentHeadline />
25-
<ContentContainer>
26-
<ContentContainer>
27-
<ContentHeadline />
28-
<ContentContainer>
29-
<ContentContainer>
30-
<ContentHeadline />
31-
<ContentContainer>
32-
<ContentContainer>
33-
<ContentHeadline />
34-
</ContentContainer>
35-
</ContentContainer>
36-
</ContentContainer>
37-
</ContentContainer>
38-
</ContentContainer>
39-
</ContentContainer>
40-
</ContentContainer>
29+
<ContentHeadline />
4130
</ContentContainer>
4231
</ContentContainer>
4332
</ContentContainer>
44-
</ContentContainer>`
33+
</ContentContainer>
34+
</ContentContainer>
35+
</ContentContainer>
36+
</ContentContainer>`
4537
});
4638

4739
const wrapper = mount(root);
48-
4940
expect(wrapper.find('main > h1').text()).toBe(String('h1'));
5041
expect(wrapper.find('main > article > h2').text()).toBe(String('h2'));
51-
expect(wrapper.find('main > article > section > article > h3').text()).toBe(String('h3'));
52-
expect(wrapper.find('main > article > section > article > section > article > h4').text()).toBe(String('h4'));
53-
expect(
54-
wrapper.find('main > article > section > article > section > article > section > article > h5').text()
55-
).toBe(String('h5'));
56-
expect(
57-
wrapper
58-
.find('main > article > section > article > section > article > section > article > section > article > h6')
59-
.text()
60-
).toBe(String('h6'));
42+
expect(wrapper.find('main > article > section > h3').text()).toBe(String('h3'));
43+
expect(wrapper.find('main > article > section > article > h4').text()).toBe(String('h4'));
44+
expect(wrapper.find('main > article > section > article > section > h5').text()).toBe(String('h5'));
45+
expect(wrapper.find('main > article > section > article > section > article > h6').text()).toBe(String('h6'));
6146
});
6247
});

test/useContentHeadline.test.js

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,53 +26,40 @@ describe('useContentHeadline', () => {
2626
const root = defineComponent({
2727
components: { ContentContainer, ContentHeadline },
2828
template: `
29+
<ContentContainer>
30+
<ContentContainer>
31+
<ContentHeadline />
2932
<ContentContainer>
3033
<ContentHeadline />
34+
<ContentContainer>
35+
<ContentHeadline />
3136
<ContentContainer>
37+
<ContentHeadline />
3238
<ContentContainer>
3339
<ContentHeadline />
3440
<ContentContainer>
35-
<ContentContainer>
36-
<ContentHeadline />
37-
<ContentContainer>
38-
<ContentContainer>
39-
<ContentHeadline />
40-
<ContentContainer>
41-
<ContentContainer>
42-
<ContentHeadline />
43-
<ContentContainer>
44-
<ContentContainer>
45-
<ContentHeadline />
46-
</ContentContainer>
47-
</ContentContainer>
48-
</ContentContainer>
49-
</ContentContainer>
50-
</ContentContainer>
51-
</ContentContainer>
52-
</ContentContainer>
41+
<ContentHeadline />
5342
</ContentContainer>
5443
</ContentContainer>
5544
</ContentContainer>
56-
</ContentContainer>`
45+
</ContentContainer>
46+
</ContentContainer>
47+
</ContentContainer>
48+
</ContentContainer>`
5749
});
5850

5951
const wrapper = mount(root);
52+
console.log(wrapper.html());
6053
expect(wrapper.find('main > h1').text()).toBe(String('h1'));
6154
expect(wrapper.find('main > article > h2').text()).toBe(String('h2'));
62-
expect(wrapper.find('main > article > section > article > h3').text()).toBe(String('h3'));
63-
expect(wrapper.find('main > article > section > article > section > article > h4').text()).toBe(String('h4'));
64-
expect(
65-
wrapper.find('main > article > section > article > section > article > section > article > h5').text()
66-
).toBe(String('h5'));
67-
expect(
68-
wrapper
69-
.find('main > article > section > article > section > article > section > article > section > article > h6')
70-
.text()
71-
).toBe(String('h6'));
55+
expect(wrapper.find('main > article > section > h3').text()).toBe(String('h3'));
56+
expect(wrapper.find('main > article > section > article > h4').text()).toBe(String('h4'));
57+
expect(wrapper.find('main > article > section > article > section > h5').text()).toBe(String('h5'));
58+
expect(wrapper.find('main > article > section > article > section > article > h6').text()).toBe(String('h6'));
7259
expect(
7360
wrapper
7461
.find(
75-
'[data-current-level="1"] > [data-current-level="3"] > [data-current-level="4"] > [data-current-level="5"] > [data-current-level="6"] > [data-current-level="7"] > [data-current-level="8"] > [data-current-level="9"] > [data-current-level="10"] > [data-current-level="11"] > h6'
62+
'[data-current-level="1"] > [data-current-level="3"] > [data-current-level="4"] > [data-current-level="5"] > [data-current-level="6"] > [data-current-level="7"] > h6'
7663
)
7764
.text()
7865
).toBe(String('h6'));

0 commit comments

Comments
 (0)