Skip to content

Commit

Permalink
Fixed broken tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gbmhunter committed Nov 10, 2023
1 parent d1cf815 commit 70eb63a
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 4 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"Overridable",
"scrollback",
"SDMMGN",
"testid",
"validatorjs"
]
}
145 changes: 143 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"start": "vite",
"build": "tsc && vite build",
"preview": "vite build && vite preview",
"test": "tsc && vitest run && playwright test"
"test": "tsc && playwright test"
},
"eslintConfig": {
"extends": [
Expand Down
5 changes: 5 additions & 0 deletions src/Settings/PortConfiguration/PortConfigurationView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ function PortConfigurationView(props: Props) {

<div style={{ height: "20px" }}></div>

{/* CONNECT AND GO TO TERMINAL CHECKBOX */}
{/* =============================================================== */}
<Tooltip title="Connect to the serial port and go to the terminal view as soon as it is selected from the popup, saving you two button presses!">
<FormControlLabel
control={
Expand All @@ -132,12 +134,15 @@ function PortConfigurationView(props: Props) {
e.target.checked
);
}}
data-testid="connect-and-go-to-terminal-checkbox"
/>
}
label="Connect to serial port and go to the terminal as soon as it is selected"
/>
</Tooltip>

{/* RECONNECT ON STARTUP CHECKBOX */}
{/* =============================================================== */}
<Tooltip title="On startup, if NinjaTerm can find last used serial port it will reselect it. If it was previously in the CONNECTED state, the port will also be re-opened.">
<FormControlLabel
control={
Expand Down
5 changes: 4 additions & 1 deletion tests/RxData.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,11 @@ test.describe('RX data', () => {
await appTestHarness.openPortAndGoToTerminalView();

await page.getByTestId('settings-button').click();
// WARNING: Escape key press is needed here otherwise the tooltip that pops
// up when the settings button is clicked above can block the click on the
// Data Processing tab!
await page.keyboard.press('Escape');
await page.getByText('Data Processing').click();
// await page.getByLabel('Don\'t move the cursor at all when a new line character is received.').click();
await page.getByTestId('new-line-dont-move-cursor').click();
await page.getByTestId('show-terminal-button').click();

Expand Down
1 change: 1 addition & 0 deletions tests/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export class AppTestHarness {
// Expect the "Go to app" button to be visible on the homepage.
await this.page.getByText(/Go to app/).click();
await this.page.getByTestId("settings-button").click();
await this.page.getByTestId('connect-and-go-to-terminal-checkbox').uncheck();
await this.page.getByTestId("request-port-access").click();
await this.page.getByText("Open Port").click();
await this.page.getByTestId("show-terminal-button").click();
Expand Down
4 changes: 4 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ export default defineConfig({
'**/dist/**',
],
testTimeout: 20000,
// browser: {
// enabled: true,
// name: 'chrome', // browser name is required
// },
},
})

0 comments on commit 70eb63a

Please sign in to comment.