Skip to content

Commit

Permalink
fix types in generate-ui-v2-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKless committed Dec 20, 2024
1 parent 65a52cc commit d54b21c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 26 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ jobs:
- run: git branch --track master origin/master
if: ${{ github.event_name == 'pull_request' }}

- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{ env.JAVA_VERSION }}
cache: gradle

- name: Ensure Nx Cloud Agents are configured correctly
run: yarn dlx nx-cloud validate --workflow-file=./.nx/workflows/agents.yaml

Expand All @@ -49,16 +59,6 @@ jobs:
- name: Install NPM dependencies
run: yarn install --immutable

- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{ env.JAVA_VERSION }}
cache: gradle

# We intentionally put the gradle tasks first because their artifacts are needed for project graph construction
# and we do not want to give the false impression that the artifact download time is part of nx commands.
- name: Gradle artifacts and formatting
Expand Down
8 changes: 4 additions & 4 deletions apps/generate-ui-v2-e2e/src/e2e/app.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('generate-ui-v2', () => {
});

it('should send message when generate button is clicked', () => {
spyOnConsoleLog().then((consoleLog) => {
spyOnConsoleLog().then((consoleLog: any) => {
cy.get("[data-cy='generate-button']").click();
expectConsoleLogToHaveBeenCalledWith(consoleLog, 'run-generator');
});
Expand All @@ -37,7 +37,7 @@ describe('generate-ui-v2', () => {
getFieldByName('array-field').type('test-value2{enter}');
getFieldByName('option2').type('test-option2');

spyOnConsoleLog().then((consoleLog) => {
spyOnConsoleLog().then((consoleLog: any) => {
cy.get('body').type('{ctrl}{enter}');
expectConsoleLogToHaveBeenCalledWith(consoleLog, 'run-generator');
expectConsoleLogToHaveBeenCalledWith(
Expand Down Expand Up @@ -87,13 +87,13 @@ describe('generate-ui-v2', () => {
cy.get('[id="search-bar"]').should('be.focused');
});
it('should be able to run generator with shortcut', () => {
spyOnConsoleLog().then((consoleLog) => {
spyOnConsoleLog().then((consoleLog: any) => {
cy.get('body').type('{ctrl}{enter}');
expectConsoleLogToHaveBeenCalledWith(consoleLog, 'run-generator');
});
});
it('should be able to dry run generator with shortcut', () => {
spyOnConsoleLog().then((consoleLog) => {
spyOnConsoleLog().then((consoleLog: any) => {
cy.get('body').type('{ctrl}{shift}{enter}');
expectConsoleLogToHaveBeenCalledWith(consoleLog, 'run-generator');
expectConsoleLogToHaveBeenCalledWith(consoleLog, '--dry-run');
Expand Down
4 changes: 2 additions & 2 deletions apps/generate-ui-v2-e2e/src/e2e/generator-context.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('generator context', () => {
visitGenerateUi(schemaProj);
getFieldByName('project').should('have.value', 'project3');

spyOnConsoleLog().then((consoleLog) => {
spyOnConsoleLog().then((consoleLog: any) => {
cy.get("[data-cy='generate-button']").click();
expectConsoleLogToHaveBeenCalledWith(consoleLog, 'run-generator');
expectConsoleLogToHaveBeenCalledWith(consoleLog, '--project=project3');
Expand All @@ -59,7 +59,7 @@ describe('generator context', () => {
};
it('should use fixed form value and use them to construct the generate command', () => {
visitGenerateUi(schemaFixed);
spyOnConsoleLog().then((consoleLog) => {
spyOnConsoleLog().then((consoleLog: any) => {
cy.get("[data-cy='generate-button']").click();
expectConsoleLogToHaveBeenCalledWith(consoleLog, 'run-generator');
expectConsoleLogToHaveBeenCalledWith(consoleLog, '--sample=value');
Expand Down
4 changes: 1 addition & 3 deletions apps/generate-ui-v2-e2e/src/support/console-spy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export const spyOnConsoleLog = (): Cypress.Chainable<
Cypress.Agent<sinon.SinonSpy>
> =>
export const spyOnConsoleLog = (): any =>
cy.window().then((win) => {
return cy.spy(win.console, 'log').as('consoleLog');
});
Expand Down
10 changes: 3 additions & 7 deletions apps/generate-ui-v2-e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "out-tsc/generate-ui-v2-e2e",
"types": ["cypress", "node", "cypress-real-events"]
"types": ["cypress", "node", "cypress-real-events"],
"lib": ["DOM"]
},
"include": [
"src/**/*.ts",
"src/**/*.js",
"cypress.config.ts",
"src/support/test-schema.ts"
],
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"references": [
{
"path": "../../libs/shared/nx-version"
Expand Down

0 comments on commit d54b21c

Please sign in to comment.