Skip to content

Commit ee92c95

Browse files
committed
SAK-51196 webcomponents Run tests on maven build
https://sakaiproject.atlassian.net/browse/SAK-51196
1 parent e0a77a8 commit ee92c95

File tree

98 files changed

+999
-1558
lines changed

Some content is hidden

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

98 files changed

+999
-1558
lines changed

Diff for: rubrics/api/src/main/bundle/rubrics.properties

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ existing student rubric scores to the default point value for selected ratings.
9090
public_rubrics_title=Publicly Shared Rubrics
9191
public_rubrics_info=Rubrics in this section were created by instructors and shared publicly with all users. You can share a rubric publicly by clicking on the "Globe" icon next to the rubric you would like to share. To use one of these rubrics in your course site, expand the "Public Rubrics" section and click on the "Copy" icon located in the "Actions" column.
9292
93-
# Rubrics in pdf
9493
export_title=Export {}
9594
export_rubric_title=Exported Rubric Title: {0}
9695
export_rubric_student=Student Name: {0}

Diff for: webcomponents/tool/pom.xml

+9-35
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,6 @@
1313
<artifactId>webcomponents</artifactId>
1414
<packaging>war</packaging>
1515

16-
<dependencies>
17-
<!--dependency>
18-
<groupId>org.sakaiproject.kernel</groupId>
19-
<artifactId>sakai-kernel-api</artifactId>
20-
</dependency>
21-
<dependency>
22-
<groupId>org.sakaiproject.kernel</groupId>
23-
<artifactId>sakai-component-manager</artifactId>
24-
</dependency>
25-
<dependency>
26-
<groupId>org.sakaiproject.kernel</groupId>
27-
<artifactId>sakai-kernel-util</artifactId>
28-
</dependency>
29-
<dependency>
30-
<groupId>org.sakaiproject.entitybroker</groupId>
31-
<artifactId>entitybroker-api</artifactId>
32-
</dependency>
33-
<dependency>
34-
<groupId>org.sakaiproject.entitybroker</groupId>
35-
<artifactId>entitybroker-utils</artifactId>
36-
</dependency>
37-
<dependency>
38-
<groupId>org.springframework</groupId>
39-
<artifactId>spring-beans</artifactId>
40-
</dependency>
41-
<dependency>
42-
<groupId>javax.servlet</groupId>
43-
<artifactId>javax.servlet-api</artifactId>
44-
</dependency>
45-
<dependency>
46-
<groupId>org.apache.commons</groupId>
47-
<artifactId>commons-lang3</artifactId>
48-
</dependency-->
49-
</dependencies>
50-
5116
<build>
5217
<plugins>
5318
<plugin>
@@ -141,6 +106,15 @@
141106
<arguments>ci --no-fund</arguments>
142107
</configuration>
143108
</execution>
109+
<execution>
110+
<id>test</id>
111+
<goals>
112+
<goal>npm</goal>
113+
</goals>
114+
<configuration>
115+
<arguments>run test</arguments>
116+
</configuration>
117+
</execution>
144118
<execution>
145119
<id>lint</id>
146120
<goals>

Diff for: webcomponents/tool/src/main/frontend/package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"lint": "eslint \"packages/**/src/*.js\" --max-warnings=0",
1111
"bundle": "esbuild \"bundle-entry-points/*.js\" --sourcemap --preserve-symlinks --bundle --splitting --format=esm --outdir=bundles --minify",
1212
"analyze-bundle": "esbuild \"bundle-entry-points/*.js\" --preserve-symlinks --splitting --bundle --metafile=meta.json --format=esm --outdir=bundles --minify",
13-
"analyze": "lit-analyzer --strict --quiet --rules.no-complex-attribute-binding=warning --rules.no-incompatible-type-binding=off \"packages/**/src/*.js\""
13+
"analyze": "lit-analyzer --strict --quiet --rules.no-complex-attribute-binding=warning --rules.no-incompatible-type-binding=off \"packages/**/src/*.js\"",
14+
"test": "lerna run test --concurrency 1 --since origin/master --stream",
15+
"test-diff": "lerna run test --concurrency 1 --since HEAD --stream"
1416
},
1517
"keywords": [],
1618
"author": "",
@@ -28,7 +30,7 @@
2830
"@sakai-ui/sakai-dialog-content": "file:packages/sakai-dialog-content",
2931
"@sakai-ui/sakai-document-viewer": "file:packages/sakai-document-viewer",
3032
"@sakai-ui/sakai-editor": "file:packages/sakai-editor",
31-
"@sakai-ui/sakai-file-list": "file:packages/sakai-file-list",
33+
"@sakai-ui/sakai-element": "file:packages/sakai-element",
3234
"@sakai-ui/sakai-grader": "file:packages/sakai-grader",
3335
"@sakai-ui/sakai-grades": "file:packages/sakai-grades",
3436
"@sakai-ui/sakai-group-picker": "file:packages/sakai-group-picker",
@@ -59,14 +61,13 @@
5961
"globals": "^15.11.0",
6062
"imagesloaded": "^5.0.0",
6163
"lint-staged": "^15.2.10",
64+
"lit": "^3.2.1",
6265
"lit-analyzer": "^2.0.3",
6366
"sinon": "^19.0.2",
6467
"sortablejs": "^1.15.3",
6568
"temporal-polyfill": "0.2.5"
6669
},
6770
"dependencies": {
68-
"@sakai-ui/sakai-element": "^3.0.6",
69-
"lerna": "^8.1.9",
70-
"lit": "^3.2.1"
71+
"lerna": "^8.1.9"
7172
}
7273
}

Diff for: webcomponents/tool/src/main/frontend/packages/sakai-announcements/test/sakai-announcements.test.js

+9-19
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
INSTRUCTOR_ORDER,
1212
} from "../src/sakai-announcements-constants.js";
1313
import * as sitePickerData from "../../sakai-site-picker/test/data.js";
14-
import { elementUpdated, expect, fixture, waitUntil, aTimeout } from "@open-wc/testing";
14+
import { elementUpdated, expect, fixture } from "@open-wc/testing";
1515
import fetchMock from "fetch-mock/esm/client";
1616

1717
describe("sakai-announcements tests", () => {
@@ -28,14 +28,14 @@ describe("sakai-announcements tests", () => {
2828
it ("renders in user mode correctly", async () => {
2929

3030
// In user mode, we'd expect to get announcements from multiple sites.
31-
let el = await fixture(html`
31+
const el = await fixture(html`
3232
<sakai-announcements user-id="${data.userId}"></sakai-announcements>
3333
`);
3434

35-
await waitUntil(() => el.dataPage);
36-
3735
await elementUpdated(el);
3836

37+
await expect(el).to.be.accessible();
38+
3939
expect(el.shadowRoot.querySelectorAll("div.title").length).to.equal(3);
4040

4141
expect(el.shadowRoot.querySelectorAll(".header").length).to.equal(3);
@@ -83,31 +83,21 @@ describe("sakai-announcements tests", () => {
8383
siteSelect.dispatchEvent(new CustomEvent("sites-selected", { detail: { value: data.vavavoom }, bubbles: true }));
8484
await elementUpdated(el);
8585
expect(el.shadowRoot.querySelectorAll("div.title").length).to.equal(1);
86+
87+
await expect(el).to.be.accessible();
8688
});
8789

8890
it ("renders in site mode correctly", async () => {
8991

90-
let el = await fixture(html`
92+
const el = await fixture(html`
9193
<sakai-announcements site-id="${data.siteId}"></sakai-announcements>
9294
`);
9395

94-
await waitUntil(() => el.dataPage);
9596
await elementUpdated(el);
9697

97-
expect(el.shadowRoot.querySelectorAll(".title").length).to.equal(2);
98+
await expect(el).to.be.accessible();
9899

100+
expect(el.shadowRoot.querySelectorAll(".title").length).to.equal(2);
99101
expect(el.shadowRoot.querySelectorAll(".header").length).to.equal(2);
100102
});
101-
102-
it ("is accessible", async () => {
103-
104-
let el = await fixture(html`
105-
<sakai-announcements user-id="${data.userId}"></sakai-announcements>
106-
`);
107-
108-
await waitUntil(() => el.dataPage);
109-
await elementUpdated(el);
110-
111-
expect(el.shadowRoot).to.be.accessible();
112-
});
113103
});
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
// import { playwrightLauncher } from '@web/test-runner-playwright';
1+
const filteredLogs = ['Lit is in dev mode. Not recommended for production! See https://lit.dev/msg/dev-mode for more information.'];
22

3-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
3+
export default ({
44

5-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
6-
/** Test files to run */
75
files: 'test/**/*.test.js',
86

97
rootDir: '../../',
108

11-
/** Resolve bare module imports */
12-
nodeResolve: {
13-
exportConditions: ['browser', 'development'],
14-
},
9+
nodeResolve: true,
1510

1611
/** Filter out lit dev mode logs */
1712
filterBrowserLogs(log) {
@@ -22,22 +17,4 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
2217
}
2318
return true;
2419
},
25-
26-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
27-
// esbuildTarget: 'auto',
28-
29-
/** Amount of browsers to run concurrently */
30-
// concurrentBrowsers: 2,
31-
32-
/** Amount of test files per browser to test concurrently */
33-
// concurrency: 1,
34-
35-
/** Browsers to run tests on */
36-
// browsers: [
37-
// playwrightLauncher({ product: 'chromium' }),
38-
// playwrightLauncher({ product: 'firefox' }),
39-
// playwrightLauncher({ product: 'webkit' }),
40-
// ],
41-
42-
// See documentation for all available options
4320
});
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
// import { playwrightLauncher } from '@web/test-runner-playwright';
1+
const filteredLogs = ['Lit is in dev mode. Not recommended for production! See https://lit.dev/msg/dev-mode for more information.'];
22

3-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
3+
export default ({
44

5-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
6-
/** Test files to run */
75
files: 'test/**/*.test.js',
86

97
rootDir: '../../',
108

11-
/** Resolve bare module imports */
12-
nodeResolve: {
13-
exportConditions: ['browser', 'development'],
14-
},
9+
nodeResolve: true,
1510

1611
/** Filter out lit dev mode logs */
1712
filterBrowserLogs(log) {
@@ -22,22 +17,4 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
2217
}
2318
return true;
2419
},
25-
26-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
27-
// esbuildTarget: 'auto',
28-
29-
/** Amount of browsers to run concurrently */
30-
// concurrentBrowsers: 2,
31-
32-
/** Amount of test files per browser to test concurrently */
33-
// concurrency: 1,
34-
35-
/** Browsers to run tests on */
36-
// browsers: [
37-
// playwrightLauncher({ product: 'chromium' }),
38-
// playwrightLauncher({ product: 'firefox' }),
39-
// playwrightLauncher({ product: 'webkit' }),
40-
// ],
41-
42-
// See documentation for all available options
4320
});
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
// import { playwrightLauncher } from '@web/test-runner-playwright';
1+
const filteredLogs = ['Lit is in dev mode. Not recommended for production! See https://lit.dev/msg/dev-mode for more information.'];
22

3-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
3+
export default ({
44

5-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
6-
/** Test files to run */
75
files: 'test/**/*.test.js',
86

97
rootDir: '../../',
108

11-
/** Resolve bare module imports */
12-
nodeResolve: {
13-
exportConditions: ['browser', 'development'],
14-
},
9+
nodeResolve: true,
1510

1611
/** Filter out lit dev mode logs */
1712
filterBrowserLogs(log) {
@@ -22,22 +17,4 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
2217
}
2318
return true;
2419
},
25-
26-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
27-
// esbuildTarget: 'auto',
28-
29-
/** Amount of browsers to run concurrently */
30-
// concurrentBrowsers: 2,
31-
32-
/** Amount of test files per browser to test concurrently */
33-
// concurrency: 1,
34-
35-
/** Browsers to run tests on */
36-
// browsers: [
37-
// playwrightLauncher({ product: 'chromium' }),
38-
// playwrightLauncher({ product: 'firefox' }),
39-
// playwrightLauncher({ product: 'webkit' }),
40-
// ],
41-
42-
// See documentation for all available options
4320
});

Diff for: webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export class SakaiTopic extends reactionsAndUpvotingMixin(SakaiElement) {
140140
this.dispatchEvent(new CustomEvent("posts-viewed", { detail: { postIds, topicId: this.topic.id } }));
141141
this.requestUpdate();
142142
} else {
143-
throw new Error("Network error while marking posts as viewed");
143+
throw new Error(`Network error while marking posts as viewed at url ${url}`);
144144
}
145145
})
146146
.catch (error => console.error(error));

Diff for: webcomponents/tool/src/main/frontend/packages/sakai-conversations/test/add-topic.test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ describe("add-topic tests", () => {
109109

110110
const lockDate = Date.now() + 3 * day;
111111

112+
112113
const lockdatePicker = el.querySelectorAll("sakai-date-picker").item(1);
113114
setTimeout(() => lockdatePicker.dispatchEvent(new CustomEvent("datetime-selected", { detail: { epochSeconds: lockDate } })));
114115

@@ -211,7 +212,5 @@ describe("add-topic tests", () => {
211212
// Check that cancel fires the event
212213
setTimeout(() => el.querySelector("#button-block input:nth-child(3)").click());
213214
await oneEvent(el, "topic-add-cancelled");
214-
215-
await expect(el).to.be.accessible();
216215
});
217216
});

0 commit comments

Comments
 (0)