Skip to content

Commit

Permalink
πŸš€ 4.0.1, #253
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail authored Jan 2, 2024
2 parents 2c46f94 + 748e17c commit eb90433
Show file tree
Hide file tree
Showing 53 changed files with 1,243 additions and 2,218 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
path: ${{ steps.yarnCache.outputs.dir }}
key: ${{ runner.os }}-build-cache-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
working-directory: ts
working-directory: ui
run: yarn install
- name: Lint
working-directory: ts
working-directory: ui
run: yarn lint
- name: Test
working-directory: ts
working-directory: ui
run: yarn test
- name: Coveralls
uses: coverallsapp/github-action@v2
Expand All @@ -43,7 +43,7 @@ jobs:
flag-name: ui
parallel: true
- name: Build JS
working-directory: ts
working-directory: ui
run: yarn build

Python:
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
- name: Types checking
run: mypy ./octoprint_octorelay
- name: Lint
run: pylint --rcfile=.pylintrc ./octoprint_octorelay ./tests
run: pylint --rcfile=.pylintrc ./octoprint_octorelay ./tests/*.py

finish:
needs: [UI, Python]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
path: ${{ steps.yarnCache.outputs.dir }}
key: ${{ runner.os }}-release-cache-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install UI dependencies
working-directory: ts
working-directory: ui
run: yarn install
- name: Build JS
working-directory: ts
working-directory: ui
run: yarn build
### Python
- name: Install Python
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Version 4

### 4.0.1

- Technical update: no new features, no fixes.

### 4.0.0

- **Breaking changes**:
Expand Down
29 changes: 0 additions & 29 deletions ts/helpers/__snapshots__/actions.spec.ts.snap

This file was deleted.

33 changes: 0 additions & 33 deletions ts/helpers/__snapshots__/countdown.spec.ts.snap

This file was deleted.

15 changes: 0 additions & 15 deletions ts/jest.config.json

This file was deleted.

3 changes: 0 additions & 3 deletions ts/mocks/OctoRelayModel.ts

This file was deleted.

7 changes: 0 additions & 7 deletions ts/mocks/actions.ts

This file was deleted.

8 changes: 0 additions & 8 deletions ts/mocks/countdown.ts

This file was deleted.

7 changes: 0 additions & 7 deletions ts/mocks/hints.ts

This file was deleted.

31 changes: 0 additions & 31 deletions ts/mocks/jQuery.ts

This file was deleted.

5 changes: 0 additions & 5 deletions ts/mocks/messageHandler.ts

This file was deleted.

11 changes: 5 additions & 6 deletions ts/.eslintrc.json β†’ ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"env": {
"es6": true,
"browser": true,
"jest": true
"es2022": true,
"browser": true
},
"extends": [
"airbnb-typescript/base",
Expand All @@ -11,8 +10,8 @@
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script",
"ecmaVersion": "latest",
"sourceType": "module",
"project": true
},
"plugins": [
Expand All @@ -24,7 +23,7 @@
},
"overrides": [
{
"files": ["tsup.config.ts"],
"files": ["*.config.ts", "mocks/*.ts"],
"rules": {
"import/no-extraneous-dependencies": "off"
}
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions ts/bindings.spec.ts β†’ ui/bindings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { readFileSync } from "node:fs";
import { JSDOM } from "jsdom";
import { describe, test, expect } from "vitest";

describe("Knockout bindings", () => {
const html = readFileSync(
Expand Down
29 changes: 29 additions & 0 deletions ui/helpers/__snapshots__/actions.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Actions > toggleRelay() action > should open the confirmation dialog > .find() 1`] = `
[
[
".modal-title",
],
[
"#octorelay-confirmation-text",
],
[
".btn-cancel",
],
[
".btn-confirm",
],
]
`;

exports[`Actions > toggleRelay() action > should open the confirmation dialog > .text() 1`] = `
[
[
"Turning Printer off",
],
[
"Are you sure you want to turn the Printer off?",
],
]
`;
33 changes: 33 additions & 0 deletions ui/helpers/__snapshots__/countdown.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 0 seconds 1`] = `"in 0 seconds"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 1 seconds 1`] = `"in 1 second"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 30 seconds 1`] = `"in 30 seconds"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 59 seconds 1`] = `"in 59 seconds"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 60 seconds 1`] = `"in 1.0 minutes"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 61 seconds 1`] = `"in 1.0 minutes"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 90 seconds 1`] = `"in 1.5 minutes"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 119 seconds 1`] = `"in 2.0 minutes"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 120 seconds 1`] = `"in 2 minutes"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 121 seconds 1`] = `"in 2 minutes"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 300 seconds 1`] = `"in 5 minutes"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 600 seconds 1`] = `"in 10 minutes"`;

exports[`Countdown helpers > formatDeadline() helper > Should format the supplied UNIX timestamp having offset 3600 seconds 1`] = `"in 1 hour"`;

exports[`Countdown helpers > getCountdownDelay() helper > should return refresh interval for supplied timestamp having offset 60 seconds 1`] = `1000`;

exports[`Countdown helpers > getCountdownDelay() helper > should return refresh interval for supplied timestamp having offset 120 seconds 1`] = `1000`;

exports[`Countdown helpers > getCountdownDelay() helper > should return refresh interval for supplied timestamp having offset 121 seconds 1`] = `60000`;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Hints helpers addPopover() helper should add a popover to the target element: .find() 1`] = `
exports[`Hints helpers > addPopover() helper > should add a popover to the target element > .find() 1`] = `
[
[
"#pop-closer",
Expand All @@ -14,7 +14,7 @@ exports[`Hints helpers addPopover() helper should add a popover to the target el
]
`;

exports[`Hints helpers addPopover() helper should add a popover to the target element: .popover() 1`] = `
exports[`Hints helpers > addPopover() helper > should add a popover to the target element > .popover() 1`] = `
[
[
{
Expand All @@ -32,7 +32,7 @@ exports[`Hints helpers addPopover() helper should add a popover to the target el
]
`;

exports[`Hints helpers showHints() helper should display tooltips 1`] = `
exports[`Hints helpers > showHints() helper > should display tooltips 1`] = `
[
[
{
Expand All @@ -49,7 +49,7 @@ exports[`Hints helpers showHints() helper should display tooltips 1`] = `
]
`;

exports[`Hints helpers showHints() helper should show popover for a single upcoming task 1`] = `
exports[`Hints helpers > showHints() helper > should show popover for a single upcoming task 1`] = `
[
[
{
Expand All @@ -67,7 +67,7 @@ exports[`Hints helpers showHints() helper should show popover for a single upcom
]
`;

exports[`Hints helpers showHints() helper should show single popover for multiple upcoming tasks 1`] = `
exports[`Hints helpers > showHints() helper > should show single popover for multiple upcoming tasks 1`] = `
[
[
{
Expand All @@ -78,7 +78,7 @@ exports[`Hints helpers showHints() helper should show single popover for multipl
]
`;

exports[`Hints helpers showHints() helper should show single popover for multiple upcoming tasks 2`] = `
exports[`Hints helpers > showHints() helper > should show single popover for multiple upcoming tasks 2`] = `
[
[
{
Expand Down
3 changes: 2 additions & 1 deletion ts/helpers/actions.spec.ts β†’ ui/helpers/actions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { elementMock, jQueryMock } from "../mocks/jQuery";
import { cancelTask, toggleRelay } from "./actions";
import { vi, describe, afterEach, test, expect } from "vitest";

describe("Actions", () => {
const apiMock = jest.fn();
const apiMock = vi.fn();

Object.assign(global, {
OctoPrint: { simpleApiCommand: apiMock },
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit eb90433

Please sign in to comment.