Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testing] Write unit and integration tests for the "resolved" feature. #9

Closed
SubtoFelix opened this issue Jan 30, 2025 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@SubtoFelix
Copy link
Contributor

SubtoFelix commented Jan 30, 2025

Estimated Effort: 2-3 hours
Dependencies: All issues related to the resolved feature
Acceptance Criteria: Ensure all resolved feature functionality is working (button exists, correctly marks as resolved, filters resolved correctly)

@Misterurias
Copy link
Contributor

Added Unit + Integration tests in the test/topics.js file

Here are some outputs:

Unit Test Output:

(venv) ➜  nodebb-s25-cheese git:(feature-resolved-field) ✗ npx mocha test/topics.js --grep "topicsController.setResolved - Unit Test"

info: configJSON
info: {
    "url": "http://localhost:4567",
    "secret": "00c97ecb-ef5a-4871-a799-f022a0f8a288",
    "database": "redis",
    "redis": {
        "host": "127.0.0.1",
        "port": "6379",
        "password": "",
        "database": "0"
    },
    "test_database": {
    "host": "127.0.0.1",
    "port": "6379",
    "password": "",
    "database": "1"
    },
    "port": "4567"
}
info: database config redis {"database":"1","host":"127.0.0.1","password":"","port":"6379"}
info: environment production

info: test_database flushed
info: Populating database with default configs, if not already set...

info: Giving default global privileges...

info: Enabling default plugins

info: [install/enableDefaultPlugins] activating default plugins {"0":"nodebb-plugin-dbsearch","1":"nodebb-widget-essentials","2":"nodebb-plugin-composer-default"}
info: [socket.io] Restricting access to origin: *:*
info: [api] Adding 0 route(s) to `api/v3/plugins`
info: [router] Routes added
info: 🎉 NodeBB Ready
info: 🤝 Enabling 'trust proxy'
info: 📡 NodeBB is now listening on: 0.0.0.0:4567
info: 🔗 Canonical URL: http://localhost:4567

  ....info: test_database flushed
info: Populating database with default configs, if not already set...

info: Giving default global privileges...

info: Enabling default plugins

info: [install/enableDefaultPlugins] activating default plugins {"0":"nodebb-plugin-dbsearch","1":"nodebb-widget-essentials","2":"nodebb-plugin-composer-default"}


  4 passing (451ms)

Integration Test Output:

(venv) ➜  nodebb-s25-cheese git:(feature-resolved-field) ✗ npx mocha test/topics.js --grep "Marking Topics as Resolved"              

info: configJSON
info: {
    "url": "http://localhost:4567",
    "secret": "00c97ecb-ef5a-4871-a799-f022a0f8a288",
    "database": "redis",
    "redis": {
        "host": "127.0.0.1",
        "port": "6379",
        "password": "",
        "database": "0"
    },
    "test_database": {
    "host": "127.0.0.1",
    "port": "6379",
    "password": "",
    "database": "1"
    },
    "port": "4567"
}
info: database config redis {"database":"1","host":"127.0.0.1","password":"","port":"6379"}
info: environment production

info: test_database flushed
info: Populating database with default configs, if not already set...

info: Giving default global privileges...

info: Enabling default plugins

info: [install/enableDefaultPlugins] activating default plugins {"0":"nodebb-plugin-dbsearch","1":"nodebb-widget-essentials","2":"nodebb-plugin-composer-default"}
info: [socket.io] Restricting access to origin: *:*
info: [api] Adding 0 route(s) to `api/v3/plugins`
info: [router] Routes added
info: 🎉 NodeBB Ready
info: 🤝 Enabling 'trust proxy'
info: 📡 NodeBB is now listening on: 0.0.0.0:4567
info: 🔗 Canonical URL: http://localhost:4567

  .....info: test_database flushed
info: Populating database with default configs, if not already set...

info: Giving default global privileges...

info: Enabling default plugins

info: [install/enableDefaultPlugins] activating default plugins {"0":"nodebb-plugin-dbsearch","1":"nodebb-widget-essentials","2":"nodebb-plugin-composer-default"}


  5 passing (980ms)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants