Skip to content

Commit

Permalink
fix: include dev files in format:check and format:fix scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Golovin <[email protected]>
  • Loading branch information
dgolovin committed May 31, 2024
1 parent c46e702 commit d2363f9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"scripts": {
"build": "rollup --bundleConfigAsCjs --config rollup.config.js --compact --environment BUILD:production && node ./scripts/build.js",
"watch": "rollup --bundleConfigAsCjs --config rollup.config.js -w",
"format:check": "prettier --end-of-line auto --cache --check \"{src,types,scripts}/**/*.{ts,js}\"",
"format:fix": "prettier --cache --write \"{src,types,scripts}/**/*.{ts,js}\"",
"format:check": "prettier --end-of-line auto --cache --check \"**/*.{ts,js}\"",
"format:fix": "prettier --cache --write \"**/*.{ts,js}\"",
"lint:clean": "rimraf .eslintcache",
"lint:fix": "node --max-old-space-size=6144 node_modules/eslint/bin/eslint.js --cache . --fix --ext js,ts",
"lint:check": "node --max-old-space-size=6144 node_modules/eslint/bin/eslint.js --cache . --ext js,ts",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ export default {
typescript(),
commonjs({ extensions: ['.js', '.ts'] }), // the ".ts" extension is required],
json(),
nodeResolve({preferBuiltins: true}),
nodeResolve({ preferBuiltins: true }),
],
};
2 changes: 1 addition & 1 deletion tests/src/setupFiles/extended-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* SPDX-License-Identifier: Apache-2.0
***********************************************************************/

import { type RunnerTestContext,takeScreenshotHook } from '@podman-desktop/tests-playwright';
import { type RunnerTestContext, takeScreenshotHook } from '@podman-desktop/tests-playwright';
import { afterEach } from 'vitest';

afterEach(async (context: RunnerTestContext) => {
Expand Down
30 changes: 20 additions & 10 deletions tests/src/sso-extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
*
* SPDX-License-Identifier: Apache-2.0
***********************************************************************/
import type { Page} from '@playwright/test';
import type { Page } from '@playwright/test';
import { expect as playExpect } from '@playwright/test';
import type { RunnerTestContext} from '@podman-desktop/tests-playwright';
import { AuthenticationPage, ExtensionCardPage, NavigationBar, PodmanDesktopRunner, WelcomePage } from '@podman-desktop/tests-playwright';
import { afterAll, beforeAll, beforeEach,describe, test } from 'vitest';
import type { RunnerTestContext } from '@podman-desktop/tests-playwright';
import {
AuthenticationPage,
ExtensionCardPage,
NavigationBar,
PodmanDesktopRunner,
WelcomePage,
} from '@podman-desktop/tests-playwright';
import { afterAll, beforeAll, beforeEach, describe, test } from 'vitest';

import { SSOExtensionPage } from './model/pages/sso-extension-page';

Expand All @@ -35,7 +41,6 @@ const authProviderName = 'Red Hat SSO';
const activeExtensionStatus = 'ACTIVE';
const disabledExtensionStatus = 'DISABLED';


beforeEach<RunnerTestContext>(async ctx => {
ctx.pdRunner = pdRunner;
});
Expand All @@ -56,7 +61,6 @@ afterAll(async () => {
});

describe('Red Hat Authentication extension verification', async () => {

test('Go to extensions and check if extension is already installed', async () => {
const extensions = await navBar.openExtensions();
if (await extensions.extensionIsInstalled(extensionLabel)) {
Expand Down Expand Up @@ -99,8 +103,12 @@ describe('Red Hat Authentication extension verification', async () => {
const authPage = await settingsBar.openTabPage(AuthenticationPage);
await playExpect(authPage.heading).toHaveText('Authentication');
const provider = authPage.getProvider(authProviderName);
await playExpect(provider.getByLabel('Provider Information').getByLabel('Provider Name')).toHaveText(authProviderName);
await playExpect(provider.getByLabel('Provider Information').getByLabel('Provider Status')).toHaveText('Logged out');
await playExpect(provider.getByLabel('Provider Information').getByLabel('Provider Name')).toHaveText(
authProviderName,
);
await playExpect(provider.getByLabel('Provider Information').getByLabel('Provider Status')).toHaveText(
'Logged out',
);
await playExpect(provider.getByLabel('Provider Actions').getByRole('button')).toContainText('Sign in');
});

Expand Down Expand Up @@ -132,7 +140,7 @@ describe('Red Hat Authentication extension verification', async () => {
const authPage = await settingsBar.openTabPage(AuthenticationPage);
await playExpect(authPage.heading).toHaveText('Authentication');
await playExpect(authPage.getProvider(authProviderName)).toHaveCount(1);
});
});
});

test('SSO extension can be removed', async () => {
Expand All @@ -145,5 +153,7 @@ async function removeExtension(): Promise<void> {
const extensionCard = await extensions.getInstalledExtension(extensionLabelName, extensionLabel);
await extensionCard.disableExtension();
await extensionCard.removeExtension();
await playExpect.poll(async () => await extensions.extensionIsInstalled(extensionLabel), { timeout: 15000 }).toBeFalsy();
await playExpect
.poll(async () => await extensions.extensionIsInstalled(extensionLabel), { timeout: 15000 })
.toBeFalsy();
}
3 changes: 2 additions & 1 deletion vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const excludeArray = [
];

export function coverageConfig(packageRoot, packageName) {
const obj = { coverage: {
const obj = {
coverage: {
all: true,
clean: true,
src: [packageRoot],
Expand Down

0 comments on commit d2363f9

Please sign in to comment.