Skip to content

UI test failures seen in 4.15 #4711

@rohityadavcloud

Description

@rohityadavcloud

On npm run test:unit, following failures were seen on the 4.15 branch:

> npm run test:unit

> [email protected] test:unit /home/rohit/lab/apache/cloudstack/ui
> vue-cli-service test:unit

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
 PASS  tests/unit/components/widgets/Status.spec.js
 PASS  tests/unit/components/view/ActionButton.spec.js
 PASS  tests/unit/views/compute/MigrateWizard.spec.js
 FAIL  tests/unit/views/AutogenView.spec.js (26.651s)
  ● Console

    console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
      [Vue warn]: Error in nextTick: "Error: expect(jest.fn()).toHaveBeenCalledWith(...expected)
      
      - Expected
      + Received
      
        Object {
          "data": URLSearchParams {},
          "method": "GET",
          "params": Object {
            "command": "testApiNameCase1",
      -     "id": "test-id-value",
      +     "id": undefined,
            "response": "json",
          },
          "url": "/",
        },
      
      Number of calls: 1"
      
      found in
      
      ---> <Resource>
             <Root>
    console.error node_modules/vue/dist/vue.runtime.common.dev.js:1884
      JestAssertionError: expect(jest.fn()).toHaveBeenCalledWith(...expected)
      
      - Expected
      + Received
      
        Object {
          "data": URLSearchParams {},
          "method": "GET",
          "params": Object {
            "command": "testApiNameCase1",
      -     "id": "test-id-value",
      +     "id": undefined,
            "response": "json",
          },
          "url": "/",
        },
      
      Number of calls: 1
          at VueComponent.call (/home/rohit/lab/apache/cloudstack/ui/tests/unit/views/AutogenView.spec.js:2167:29)
          at Array.<anonymous> (/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
          at flushCallbacks (/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1902:5) {
        matcherResult: { message: [Function], pass: false }
      }
    console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
      [Vue warn]: Error in nextTick: "Error: expect(jest.fn()).toHaveBeenCalledWith(...expected)
      
      - Expected
      + Received
      
        Object {
          "data": URLSearchParams {},
          "method": "GET",
          "params": Object {
            "command": "testApiNameCase1",
      -     "id": "test-id-value",
      +     "id": undefined,
            "response": "json",
          },
          "url": "/",
        },
      
      Number of calls: 1"
      
      found in
      
      ---> <Resource>
             <Root>
    console.error node_modules/vue/dist/vue.runtime.common.dev.js:1884
      JestAssertionError: expect(jest.fn()).toHaveBeenCalledWith(...expected)
      
      - Expected
      + Received
      
        Object {
          "data": URLSearchParams {},
          "method": "GET",
          "params": Object {
            "command": "testApiNameCase1",
      -     "id": "test-id-value",
      +     "id": undefined,
            "response": "json",
          },
          "url": "/",
        },
      
      Number of calls: 1
          at VueComponent.call (/home/rohit/lab/apache/cloudstack/ui/tests/unit/views/AutogenView.spec.js:2218:29)
          at Array.<anonymous> (/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
          at flushCallbacks (/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1902:5) {
        matcherResult: { message: [Function], pass: false }
      }
    console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
      [Vue warn]: Error in nextTick: "Error: expect(jest.fn()).toHaveBeenCalledWith(...expected)
      
      - Expected
      + Received
      
        Object {
          "data": URLSearchParams {},
          "method": "GET",
          "params": Object {
      -     "column1": false,
      +     "column1": undefined,
            "command": "testApiNameCase1",
            "response": "json",
          },
          "url": "/",
        },
      
      Number of calls: 1"
      
      found in
      
      ---> <Resource>
             <Root>
    console.error node_modules/vue/dist/vue.runtime.common.dev.js:1884
      JestAssertionError: expect(jest.fn()).toHaveBeenCalledWith(...expected)
      
      - Expected
      + Received
      
        Object {
          "data": URLSearchParams {},
          "method": "GET",
          "params": Object {
      -     "column1": false,
      +     "column1": undefined,
            "command": "testApiNameCase1",
            "response": "json",
          },
          "url": "/",
        },
      
      Number of calls: 1
          at VueComponent.call (/home/rohit/lab/apache/cloudstack/ui/tests/unit/views/AutogenView.spec.js:2266:29)
          at Array.<anonymous> (/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
          at flushCallbacks (/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1902:5) {
        matcherResult: { message: [Function], pass: false }
      }

  ● Views > AutogenView.vue › Methods › execSubmit() › check api is called with params has item id equal resource.id

    : Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:

      2130 |       })
      2131 | 
    > 2132 |       it('check api is called with params has item id equal resource.id', (done) => {
           |       ^
      2133 |         wrapper = factory({
      2134 |           data: {
      2135 |             showAction: true,

      at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
      at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2132:7)
      at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2098:5)
      at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:228:3)
      at Object.<anonymous> (tests/unit/views/AutogenView.spec.js:88:1)

  ● Views > AutogenView.vue › Methods › execSubmit() › check api is called when form has input key not exist in currentAction.params

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    - Expected
    + Received

      Object {
        "data": URLSearchParams {},
        "method": "GET",
        "params": Object {
          "command": "testApiNameCase1",
    -     "id": "test-id-value",
    +     "id": undefined,
          "response": "json",
        },
        "url": "/",
      },

    Number of calls: 1

      2165 | 
      2166 |           expect(mockAxios).toHaveBeenCalledTimes(1)
    > 2167 |           expect(mockAxios).toHaveBeenCalledWith({
           |                             ^
      2168 |             url: '/',
      2169 |             method: 'GET',
      2170 |             data: new URLSearchParams(),

      at VueComponent.call (tests/unit/views/AutogenView.spec.js:2167:29)
      at Array.<anonymous> (node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
      at flushCallbacks (node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)

  ● Views > AutogenView.vue › Methods › execSubmit() › check api is called when form has input key not exist in currentAction.params

    : Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:

      2180 |       })
      2181 | 
    > 2182 |       it('check api is called when form has input key not exist in currentAction.params', (done) => {
           |       ^
      2183 |         wrapper = factory({
      2184 |           data: {
      2185 |             showAction: true,

      at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
      at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2182:7)
      at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2098:5)
      at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:228:3)
      at Object.<anonymous> (tests/unit/views/AutogenView.spec.js:88:1)

  ● Views > AutogenView.vue › Methods › execSubmit() › check api is called when form has input key exist in currentAction.params, type is boolean and value is undefined

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    - Expected
    + Received

      Object {
        "data": URLSearchParams {},
        "method": "GET",
        "params": Object {
          "command": "testApiNameCase1",
    -     "id": "test-id-value",
    +     "id": undefined,
          "response": "json",
        },
        "url": "/",
      },

    Number of calls: 1

      2216 | 
      2217 |           expect(mockAxios).toHaveBeenCalledTimes(1)
    > 2218 |           expect(mockAxios).toHaveBeenCalledWith({
           |                             ^
      2219 |             url: '/',
      2220 |             method: 'GET',
      2221 |             data: new URLSearchParams(),

      at VueComponent.call (tests/unit/views/AutogenView.spec.js:2218:29)
      at Array.<anonymous> (node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
      at flushCallbacks (node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)

  ● Views > AutogenView.vue › Methods › execSubmit() › check api is called when form has input key exist in currentAction.params, type is boolean and value is undefined

    : Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:

      2231 |       })
      2232 | 
    > 2233 |       it('check api is called when form has input key exist in currentAction.params, type is boolean and value is undefined', (done) => {
           |       ^
      2234 |         wrapper = factory({
      2235 |           data: {
      2236 |             showAction: true,

      at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
      at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2233:7)
      at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2098:5)
      at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:228:3)
      at Object.<anonymous> (tests/unit/views/AutogenView.spec.js:88:1)

  ● Views > AutogenView.vue › Methods › execSubmit() › check api is called when form has input key exist in currentAction.params, type is boolean and value is null

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    - Expected
    + Received

      Object {
        "data": URLSearchParams {},
        "method": "GET",
        "params": Object {
    -     "column1": false,
    +     "column1": undefined,
          "command": "testApiNameCase1",
          "response": "json",
        },
        "url": "/",
      },

    Number of calls: 1

      2264 | 
      2265 |           expect(mockAxios).toHaveBeenCalledTimes(1)
    > 2266 |           expect(mockAxios).toHaveBeenCalledWith({
           |                             ^
      2267 |             url: '/',
      2268 |             method: 'GET',
      2269 |             data: new URLSearchParams(),

      at VueComponent.call (tests/unit/views/AutogenView.spec.js:2266:29)
      at Array.<anonymous> (node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
      at flushCallbacks (node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)


=============================== Coverage summary ===============================
Statements   : 4.65% ( 708/15242 )
Branches     : 5.71% ( 437/7654 )
Functions    : 2.49% ( 125/5019 )
Lines        : 4.64% ( 704/15157 )
================================================================================
Test Suites: 1 failed, 3 passed, 4 total
Tests:       4 failed, 130 passed, 134 total
Snapshots:   0 total
Time:        38.195s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:unit: `vue-cli-service test:unit`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test:unit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rohit/.npm/_logs/2021-02-19T09_55_53_167Z-debug.log
ISSUE TYPE
  • Bug Report
COMPONENT NAME
UI

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions