-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
124 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/**** Tests ****/ | ||
|
||
@import 'variables.css'; | ||
@import '../node_modules/modern-normalize/modern-normalize.css'; | ||
@import 'fonts.css'; | ||
|
||
/* Toolkit Validation */ | ||
|
||
:root { | ||
--color-red: oklch(63% 0.29 29); | ||
--color-green: oklch(63% 0.24 142); | ||
} | ||
|
||
body { | ||
margin-inline: var(--space-base); | ||
font-family: 'Source Sans', Arial, sans-serif; | ||
} | ||
|
||
h1 { | ||
font-size: 2rem; | ||
font-weight: 500; | ||
} | ||
|
||
h2 { | ||
font-size: 1.5rem; | ||
font-weight: 400; | ||
} | ||
|
||
code { | ||
color: var(--color-red); | ||
} | ||
|
||
.test-checkmark { | ||
display: flex; | ||
align-items: center; | ||
gap: var(--space-sm); | ||
|
||
&::after { | ||
content: ''; | ||
flex: none; | ||
block-size: 1rem; | ||
inline-size: 1rem; | ||
background-color: var(--color-green); | ||
mask: url('data-url:/fa-solid/check.svg') center / contain; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// ***** Tests ***** // | ||
|
||
// JavaScript Test: | ||
|
||
const testJavaScript = document.querySelector('.test-js strong') | ||
|
||
testJavaScript.innerText = 'yes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>CDLIB UI Tests</title> | ||
<meta name="color-scheme" content="light dark"> | ||
<meta name="robots" content="noindex"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> | ||
<link rel="stylesheet" href="{{ path '/dist/css/tests.css' }}" media="all"> | ||
</head> | ||
<body> | ||
{{{ yield }}} | ||
<script src="{{ path '/dist/js/tests.js' }}"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
order: 1, | ||
order: 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
root: true, | ||
order: 4, | ||
preview: '@template-tests' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { faker } = require('@faker-js/faker/locale/en'); | ||
|
||
module.exports = { | ||
label: 'Toolkit', | ||
context: { | ||
toolkit: { | ||
paragraph: faker.lorem.paragraphs() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<h1>Toolkit Validation</h1> | ||
|
||
<h2>Loading of Source Sans Font</h2> | ||
|
||
<p>This sentence and all text on this page should be rendered in the Source Sans font. Custom font variants for <strong>bold</strong>, <em>italic</em> and <strong><em>bolded italic</em></strong> should also be present.</p> | ||
|
||
<h2>Faker Library</h2> | ||
|
||
<p>The following paragraph is random text generated by the Faker module and inlined into this page by a Handlebars expression:</p> | ||
|
||
<blockquote> | ||
{{ toolkit.paragraph }} | ||
</blockquote> | ||
|
||
<h2>Font Awesome Icons</h2> | ||
|
||
<p class="test-checkmark">This sentence should contain a green checkmark at the end.</p> | ||
<p>This verifies that a Font Awesome icon is getting rendered from the fontawesome-pro module using a <a href="https://parceljs.org/features/dependency-resolution/#file-aliases">Parcel file alias</a> (defined in package.json) and inlining the image into the stylesheet as a <a href="https://parceljs.org/features/bundle-inlining/#inlining-as-a-data-url">data URL</a>.</p> | ||
|
||
<h2>JavaScript</h2> | ||
|
||
<p class="test-js">Is JavaScript getting compiled and loading on this page [yes/no]? <strong>no</strong></p> | ||
|
||
<h2>Images</h2> | ||
|
||
<p>This SVG's <code>src</code> attribute has a path to the toolkit's compiled images at <strong>/dist/images/</strong> and contains a Handlebars expression and Fractal <code>path</code> variable:</p> | ||
|
||
<img src="{{ path '/dist/images/favicon.svg' }}" alt="California Digital Library website favicon"> | ||
|
||
<h2>Visually Verify</h2> | ||
|
||
<ol> | ||
<li>This page's elements are rendering the same in the current versions of Chrome, Firefox and Safari desktop browsers; verify older browser rendering per project requirements</li> | ||
<li>CSS is getting compiled to <strong>/dist/css/test.css</strong> with <a href="https://parceljs.org/languages/css/#vendor-prefixing">Parcel vendor prefixing</a> (such as adding <code>-webkit-mask</code>) and other <a href="https://parceljs.org/languages/css/#syntax-lowering">Parcel transpilations</a> (verify CSS logical properties)</li> | ||
<li>Images are rendering when served from this page hosted on <a href="https://cdlib.github.io/intracdl-ui">GitHub Pages</a> (verifying that file paths aren't broken)</li> | ||
<li>Source maps (when using the toolkit in development mode) are correctly referencing this page's element styles to the <strong>test.css</strong> and <strong>main.css</strong> stylesheets and line numbers (verify with browser inspector tool)</li> | ||
</ul> |