Skip to content

Commit 934e6ff

Browse files
authored
Merge pull request #27 from oslabs-beta/staging
Merge Staging to Main
2 parents de3ef44 + 45de588 commit 934e6ff

File tree

8 files changed

+121
-15
lines changed

8 files changed

+121
-15
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Spearmint",
3-
"version": "0.1.0",
3+
"version": "2.0.0",
44
"description": "Spearmint",
55
"author": "spearmintjs",
66
"build": {
@@ -46,6 +46,8 @@
4646
"react-start": "react-scripts start",
4747
"react-build": "NODE_ENV=production react-scripts build",
4848
"test": "react-scripts test --env=jsdom",
49+
"test:e2e": "./node_modules/mocha/bin/mocha src/__tests__/spec.e2e.js",
50+
"test:integra": "mocha src/__tests__/spec.integra.js",
4951
"test:watch": "jest --watch",
5052
"react-eject": "react-scripts eject",
5153
"electron-build": "NODE_ENV=production electron-builder -mwl",
@@ -74,6 +76,8 @@
7476
"@types/jest": "^25.2.3",
7577
"@typescript-eslint/eslint-plugin": "^2.33.0",
7678
"@typescript-eslint/parser": "^2.33.0",
79+
"chai": "^4.3.4",
80+
"chai-as-promised": "^7.1.1",
7781
"electron": "^5.0.3",
7882
"electron-builder": "^22.6.1",
7983
"electron-devtools-installer": "^3.0.0",
@@ -84,6 +88,7 @@
8488
"eslint-plugin-jsx-a11y": "^6.2.3",
8589
"eslint-plugin-react": "^7.20.0",
8690
"eslint-plugin-react-hooks": "^2.5.1",
91+
"mocha": "^8.3.2",
8792
"react-test-renderer": "^16.12.0",
8893
"spectron": "^5.0.0",
8994
"test-data-bot": "^0.8.0"

public/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
work correctly both with client-side routing and a non-root public URL.
2121
Learn how to configure a non-root public URL by running `npm run build`.
2222
-->
23-
<title>spearmint</title>
23+
<title>spearmint | testing, simplified</title>
2424
</head>
2525

2626
<body>
@@ -42,6 +42,5 @@
4242
return '/monaco-editor-worker-loader-proxy.js';
4343
},
4444
};
45-
// require(['vs/editor/editor.main'], function() {});
4645
</script>
4746
</html>

src/__tests__/spec.e2e.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const Application = require('spectron').Application;
2+
const path = require('path');
3+
const chai = require('chai');
4+
const chaiAsPromised = require('chai-as-promised');
5+
6+
// specifies the path of the application to launch
7+
const electronPath = require('electron');
8+
9+
// tell spectron to look and use the main.js file + package.json located 2 levels above
10+
const appPath = path.join(__dirname, '../..');
11+
12+
13+
// instantiates the spearmint application given the optional paramaters of the Application API
14+
const app = new Application({
15+
path: electronPath, // string path to the Electron application executable to launch
16+
args: [appPath], // array of paths to find the executable files and package.json
17+
});
18+
19+
// define the use of chai and chai as promised packages
20+
global.before(function () {
21+
chai.should();
22+
chai.use(chaiAsPromised);
23+
});
24+
25+
describe('Application Accessibility Audit', function () {
26+
this.timeout(10000);
27+
28+
beforeEach(function () {
29+
return app.start();
30+
});
31+
32+
afterEach(function () {
33+
if (app && app.isRunning()) {
34+
return app.stop();
35+
}
36+
});
37+
38+
it('Audits Accessibility', function (done) {
39+
app.client.auditAccessibility().then(function (audit) {
40+
if (audit.failed) {
41+
console.error('Please address the following accessibility issues in your application: \n', audit.results)
42+
}
43+
else {
44+
console.log('No accessibility issues have been found.')
45+
}
46+
done()
47+
})
48+
});
49+
});

src/__tests__/spec.integra.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const Application = require('spectron').Application;
2+
const path = require('path');
3+
const assert = require('assert');
4+
5+
// specifies the path of the application to launch
6+
const electronPath = require('electron');
7+
8+
// tell spectron to look and use the main.js file + package.json located 2 levels above
9+
const appPath = path.join(__dirname, '../..');
10+
11+
// instantiates the spearmint application given the optional paramaters of the Application API
12+
const app = new Application({
13+
path: electronPath, // string path to the Electron application executable to launch
14+
args: [appPath], // array of paths to find the executable files and package.json
15+
});
16+
17+
18+
describe('Application Accessibility Audit', function () {
19+
this.timeout(10000);
20+
21+
beforeEach(function () {
22+
return app.start();
23+
});
24+
25+
afterEach(function () {
26+
if (app && app.isRunning()) {
27+
return app.stop();
28+
}
29+
});
30+
31+
it('Audits Accessibility', function () {
32+
return app.client.auditAccessibility().then(function (audit) {
33+
if (audit.failed) {
34+
console.error('Please address the following accessibility issues in your application: \n', audit.results)
35+
}
36+
else {
37+
console.log('No accessibility issues have been found.')
38+
}
39+
})
40+
});
41+
});

src/assets/stylesheets/colors.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
$mint: #02c2c3;
2-
$mint2: #69e5ce;
1+
$mint: #038181;
2+
$mint2: #02c3c33f;
33
$dark-gray: #808080;
44
$light-gray: #d5d5d5;
55
$light-gray2: #f6f8f9;

src/pages/ProjectLoader/ProjectLoader.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,19 @@ const ProjectLoader = () => {
4040
<section id={styles.upperPart}>
4141
<span id={styles.title}>spearmint</span>
4242
<svg
43+
id={styles.leaf}
4344
viewBox='0 0 24 24'
4445
xmlns='http://www.w3.org/2000/svg'
4546
xmlnsXlink='http://www.w3.org/1999/xlink'
46-
id={styles.leaf}
47-
>
47+
>
4848
<path
4949
fill='#ffffff'
5050
d='M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C19,20 22,3 22,3C21,5 14,5.25 9,6.25C4,7.25 2,11.5 2,13.5C2,15.5 3.75,17.25 3.75,17.25C7,8 17,8 17,8Z'
51-
/>
51+
/>
5252
</svg>
53+
<span id={styles.purpose}>testing, simplified</span>
5354
</section>
55+
5456
<section id={styles.lowerPart}>
5557
<div id={styles.appBox}>
5658
<div className={styles.contentBox}>
@@ -60,7 +62,7 @@ const ProjectLoader = () => {
6062
</div>
6163
<div className={styles.contentBox}>
6264
<span className={styles.number}>02</span>
63-
<span className={styles.text}>Select your application</span> <br />
65+
<span className={styles.text}>Select your application</span> <br/>
6466
<OpenFolder />
6567
</div>
6668
</div>

src/pages/ProjectLoader/ProjectLoader.module.scss

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
#upperPart {
55
width: 100%;
66
height: 50vh;
7-
background-color: #02c2c3;
7+
background-color: #038181;
88
display: flex;
9+
flex-direction: column;
910
justify-content: center;
10-
align-items: flex-end;
11+
align-items: center;
1112
}
1213

1314
#title {
@@ -16,7 +17,17 @@
1617
vertical-align: bottom;
1718
font-family: 'comfortaa';
1819
color: #fff;
19-
margin-bottom: 30px;
20+
padding-top: 30px;
21+
margin-top: 30px;
22+
flex: 1;
23+
}
24+
25+
#purpose {
26+
font-size: 1rem;
27+
text-align: center;
28+
font-family: 'comfortaa';
29+
color: #fff;
30+
flex: 1;
2031
}
2132

2233
#leaf {
@@ -94,8 +105,6 @@
94105
#helpBtn {
95106
color: white;
96107
background-color: $mint;
97-
// margin-right: 4px;
98-
// margin-bottom: 4px;
99108
margin: 15px 4px 4px 4px;
100109
height: 40px;
101110
width: 110px;

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"include": [
2424
"src",
2525
"src/context/__tests__",
26-
"__tests__/hello.test.js"
26+
"__tests__/hello.test.js",
27+
"tests/spec.integra.js"
2728
]
2829
}

0 commit comments

Comments
 (0)