Skip to content

Commit c9e3ae4

Browse files
authored
test: framework testing (#1011)
* inital stab at framework testing * more react and vue tests * tests for cta, datetime, dropdown, health-index, icon, icon-panel, jump-links, markdown, modal, navigation, number, page-status, and progress-indicator * adding jump-links tests * framework tests for select, tabs, and toast * fixing pfe-content-set react test * fixing datetime tests in react React seems to be a bit weird about attribute order. Moving the datetime attribute to the end seems to fix it. * updating pfe-dropdown test to skip a single test for Vue and React * skip one pfe-health-index test in React * removing react tests and commenting out a Vue test * adding a pfe-jump-links test back for Vue * removing the failing React tests for pfe-navigation * package-lock updates * Revert "package-lock updates" This reverts commit 29cd01a. * updating package-lock.json * using the root div instead of document.body for React * updating pfe-autocomplete tests
1 parent 57978b7 commit c9e3ae4

File tree

125 files changed

+21168
-22187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+21168
-22187
lines changed

elements/pfe-accordion/test/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<script>
1010
// Load and run all tests (.html, .js):
1111
WCT.loadSuites([
12-
'pfe-accordion_test.html'
12+
'pfe-accordion_test.html',
13+
'pfe-accordion_react_test.html',
14+
'pfe-accordion_vue_test.html'
1315
]);
1416
</script>
1517

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
6+
<script src="/components/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
7+
<script src="/components/web-component-tester/browser.js"></script>
8+
<script src="/components/react/umd/react.production.min.js"></script>
9+
<script src="/components/react-dom/umd/react-dom.production.min.js"></script>
10+
<script src="/components/babel-standalone/babel.min.js"></script>
11+
<script type="module" src="../dist/pfe-accordion.js"></script>
12+
<script type="text/babel">
13+
function TestSuite() {
14+
return (
15+
<div>
16+
<pfe-accordion>
17+
<pfe-accordion-header id="header1">
18+
<h2>Why do wizards need money if they could just create it?</h2>
19+
</pfe-accordion-header>
20+
<pfe-accordion-panel id="panel1">
21+
<p>There is legislation that decides what you can conjure and what you can not. Because things that you conjure out of thin air will not last, it is illegal in the wizarding world.</p>
22+
</pfe-accordion-panel>
23+
<pfe-accordion-header>
24+
<h2>Why doesn't Harry have a portrait of his parents?</h2>
25+
</pfe-accordion-header>
26+
<pfe-accordion-panel>
27+
<p>The characters in the portraits are not actually ghosts. They mainly are there just to repeat common phrases or serve as a general representation of the individual they depict. A portrait of his parents would not be of much help to Harry.</p>
28+
</pfe-accordion-panel>
29+
<pfe-accordion-header>
30+
<h2>Why is Harry considered a half-blood if both of his parents could use magic?</h2>
31+
</pfe-accordion-header>
32+
<pfe-accordion-panel>
33+
<p>Because Harry's grandparents were not able to do magic. This is generally frowned upon by those who consider themselves pure, such as the Malfoy's or other antagonists.</p>
34+
</pfe-accordion-panel>
35+
<pfe-accordion-header>
36+
<h2>Is Hogwarts the only wizarding school?</h2>
37+
</pfe-accordion-header>
38+
<pfe-accordion-panel>
39+
<p>No! It has been revealed that there are actually 11 long established and prestigious schools around the globe. These include Castelobruxo in the rainforest of Brazil, Durmstrang Institute (whereas nobody is certain of it’s whereabouts), and Ilvermorny, right here in the United States.</p>
40+
</pfe-accordion-panel>
41+
<pfe-accordion-header>
42+
<h2>Where do the main characters work as adults?</h2>
43+
</pfe-accordion-header>
44+
<pfe-accordion-panel>
45+
<p>Harry and Hermione are at the Ministry: he ends up leading the Auror department. Ron helps George at the joke shop and does very well. Ginny becomes a professional Quidditch player and then sportswriter for the Daily Prophet.</p>
46+
<p><a href="https://www.pottermore.com/collection/characters" target="blank">Read more about the characters</a></p>
47+
</pfe-accordion-panel>
48+
</pfe-accordion>
49+
50+
<pfe-accordion id="dynamic">
51+
<pfe-accordion-header>
52+
<h2>Header</h2>
53+
</pfe-accordion-header>
54+
<pfe-accordion-panel>
55+
Panel
56+
</pfe-accordion-panel>
57+
</pfe-accordion>
58+
59+
<pfe-accordion id="dont-disclosure-me" pfe-disclosure="false">
60+
<pfe-accordion-header>
61+
<h2>Header</h2>
62+
</pfe-accordion-header>
63+
<pfe-accordion-panel>
64+
Panel
65+
</pfe-accordion-panel>
66+
</pfe-accordion>
67+
68+
<pfe-accordion id="should-become-a-disclosure">
69+
<pfe-accordion-header>
70+
<h2>Header</h2>
71+
</pfe-accordion-header>
72+
<pfe-accordion-panel>
73+
Panel
74+
</pfe-accordion-panel>
75+
<pfe-accordion-header>
76+
<h2>Header</h2>
77+
</pfe-accordion-header>
78+
<pfe-accordion-panel>
79+
Panel
80+
</pfe-accordion-panel>
81+
</pfe-accordion>
82+
83+
<pfe-accordion id="should-switch-to-accordion">
84+
<pfe-accordion-header>
85+
<h2>Header</h2>
86+
</pfe-accordion-header>
87+
<pfe-accordion-panel>
88+
Panel
89+
</pfe-accordion-panel>
90+
</pfe-accordion>
91+
</div>
92+
);
93+
}
94+
95+
ReactDOM.render(TestSuite(), document.querySelector("#root"));
96+
</script>
97+
</head>
98+
<body>
99+
<div id="root"></div>
100+
<script src="pfe-accordion_test.js"></script>
101+
</body>
102+
</html>

0 commit comments

Comments
 (0)