Skip to content

Commit

Permalink
Fix references to atVersionAttributes and browserVersionAttributes fo…
Browse files Browse the repository at this point in the history
…r TestPlanVersionService
  • Loading branch information
howard-e committed May 17, 2023
1 parent b58af8b commit a9450fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 43 deletions.
41 changes: 4 additions & 37 deletions server/models/services/TestPlanVersionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ const {
TEST_PLAN_RUN_ATTRIBUTES,
USER_ATTRIBUTES,
AT_ATTRIBUTES,
BROWSER_ATTRIBUTES,
AT_VERSION_ATTRIBUTES,
BROWSER_VERSION_ATTRIBUTES
BROWSER_ATTRIBUTES
} = require('./helpers');
const { Sequelize, sequelize, TestPlanVersion } = require('../');
const { Op } = Sequelize;
Expand All @@ -17,29 +15,25 @@ const { Op } = Sequelize;
/**
* @param {string[]} testPlanReportAttributes - TestPlanReport attributes
* @param {string[]} atAttributes - AT attributes
* @param {string[]} atVersionAttributes - AT version attributes
* @param {string[]} browserAttributes - Browser attributes
* @param {string[]} browserVersionAttributes - Browser version attributes
* @param {string[]} testPlanRunAttributes - TestPlanRun attributes
* @param {string[]} userAttributes - User attributes
* @returns {{association: string, attributes: string[]}}
*/
const testPlanReportAssociation = (
testPlanReportAttributes,
atAttributes,
atVersionAttributes,
browserAttributes,
browserVersionAttributes,
testPlanRunAttributes,
userAttributes
) => ({
association: 'testPlanReports',
attributes: testPlanReportAttributes,
include: [
// eslint-disable-next-line no-use-before-define
atAssociation(atAttributes, atVersionAttributes),
atAssociation(atAttributes),
// eslint-disable-next-line no-use-before-define
browserAssociation(browserAttributes, browserVersionAttributes),
browserAssociation(browserAttributes),
// eslint-disable-next-line no-use-before-define
testPlanRunAssociation(testPlanRunAttributes, userAttributes)
]
Expand All @@ -61,7 +55,6 @@ const testPlanRunAssociation = (testPlanRunAttributes, userAttributes) => ({

/**
* @param {string[]} atAttributes - AT attributes
* @param {string[]} atVersionAttributes - AT version attributes
* @returns {{association: string, attributes: string[]}}
*/
const atAssociation = atAttributes => ({
Expand All @@ -71,7 +64,6 @@ const atAssociation = atAttributes => ({

/**
* @param {string[]} browserAttributes - Browser attributes
* @param {string[]} browserVersionAttributes - Browser version attributes
* @returns {{association: string, attributes: string[]}}
*/
const browserAssociation = browserAttributes => ({
Expand All @@ -94,9 +86,7 @@ const userAssociation = userAttributes => ({
* @param {string[]} testPlanVersionAttributes - TestPlanVersion attributes to be returned in the result
* @param {string[]} testPlanReportAttributes - TestPlanReport attributes to be returned in the result
* @param {string[]} atAttributes - AT attributes to be returned in the result
* @param {string[]} atVersionAttributes - AT version attributes to be returned in the result
* @param {string[]} browserAttributes - Browser attributes to be returned in the result
* @param {string[]} browserVersionAttributes - Browser version attributes to be returned in the result
* @param {string[]} testPlanRunAttributes - TestPlanRun attributes to be returned in the result
* @param {string[]} userAttributes - User attributes to be returned in the result
* @param {object} options - Generic options for Sequelize
Expand All @@ -108,9 +98,7 @@ const getTestPlanVersionById = async (
testPlanVersionAttributes = TEST_PLAN_VERSION_ATTRIBUTES,
testPlanReportAttributes = TEST_PLAN_REPORT_ATTRIBUTES,
atAttributes = AT_ATTRIBUTES,
atVersionAttributes = AT_VERSION_ATTRIBUTES,
browserAttributes = BROWSER_ATTRIBUTES,
browserVersionAttributes = BROWSER_VERSION_ATTRIBUTES,
testPlanRunAttributes = TEST_PLAN_RUN_ATTRIBUTES,
userAttributes = USER_ATTRIBUTES,
options = {}
Expand All @@ -123,9 +111,7 @@ const getTestPlanVersionById = async (
testPlanReportAssociation(
testPlanReportAttributes,
atAttributes,
atVersionAttributes,
browserAttributes,
browserVersionAttributes,
testPlanRunAttributes,
userAttributes
)
Expand All @@ -136,14 +122,12 @@ const getTestPlanVersionById = async (

/**
* @param {string|any} search - use this to combine with {@param filter} to be passed to Sequelize's where clause
* @param {object} filter - use this define conditions to be passed to Sequelize's where clause
* @param {object} filter - use this to define conditions to be passed to Sequelize's where clause
* @param {string[]} testPlanReportAttributes - TestPlanReport attributes to be returned in the result
* @param {string[]} testPlanRunAttributes - TestPlanRun attributes to be returned in the result
* @param {string[]} testPlanVersionAttributes - TestPlanVersion attributes to be returned in the result
* @param {string[]} atAttributes - AT attributes to be returned in the result
* @param {string[]} atVersionAttributes - AT version attributes to be returned in the result
* @param {string[]} browserAttributes - Browser attributes to be returned in the result
* @param {string[]} browserVersionAttributes - Browser version attributes to be returned in the result
* @param {string[]} userAttributes - User attributes to be returned in the result
* @param {object} pagination - pagination options for query
* @param {number} [pagination.page=0] - page to be queried in the pagination result (affected by {@param pagination.enablePagination})
Expand All @@ -160,9 +144,7 @@ const getTestPlanVersions = async (
testPlanVersionAttributes = TEST_PLAN_VERSION_ATTRIBUTES,
testPlanReportAttributes = TEST_PLAN_REPORT_ATTRIBUTES,
atAttributes = AT_ATTRIBUTES,
atVersionAttributes = AT_VERSION_ATTRIBUTES,
browserAttributes = BROWSER_ATTRIBUTES,
browserVersionAttributes = BROWSER_VERSION_ATTRIBUTES,
testPlanRunAttributes = TEST_PLAN_RUN_ATTRIBUTES,
userAttributes = USER_ATTRIBUTES,
pagination = {},
Expand All @@ -181,9 +163,7 @@ const getTestPlanVersions = async (
testPlanReportAssociation(
testPlanReportAttributes,
atAttributes,
atVersionAttributes,
browserAttributes,
browserVersionAttributes,
testPlanRunAttributes,
userAttributes
)
Expand All @@ -198,9 +178,7 @@ const getTestPlanVersions = async (
* @param {string[]} testPlanVersionAttributes - TestPlanVersion attributes to be returned in the result
* @param {string[]} testPlanReportAttributes - TestPlanReport attributes to be returned in the result
* @param {string[]} atAttributes - AT attributes to be returned in the result
* @param {string[]} atVersionAttributes - AT version attributes to be returned in the result
* @param {string[]} browserAttributes - Browser attributes to be returned in the result
* @param {string[]} browserVersionAttributes - Browser version attributes to be returned in the result
* @param {string[]} testPlanRunAttributes - TestPlanRun attributes to be returned in the result
* @param {string[]} userAttributes - User attributes to be returned in the result
* @param {object} options - Generic options for Sequelize
Expand All @@ -224,9 +202,7 @@ const createTestPlanVersion = async (
testPlanVersionAttributes = TEST_PLAN_VERSION_ATTRIBUTES,
testPlanReportAttributes = TEST_PLAN_REPORT_ATTRIBUTES,
atAttributes = AT_ATTRIBUTES,
atVersionAttributes = AT_VERSION_ATTRIBUTES,
browserAttributes = BROWSER_ATTRIBUTES,
browserVersionAttributes = BROWSER_VERSION_ATTRIBUTES,
testPlanRunAttributes = TEST_PLAN_RUN_ATTRIBUTES,
userAttributes = USER_ATTRIBUTES,
options = {}
Expand All @@ -248,9 +224,7 @@ const createTestPlanVersion = async (
testPlanVersionAttributes,
testPlanReportAttributes,
atAttributes,
atVersionAttributes,
browserAttributes,
browserVersionAttributes,
testPlanRunAttributes,
userAttributes,
options
Expand All @@ -263,9 +237,7 @@ const createTestPlanVersion = async (
* @param {string[]} testPlanVersionAttributes - TestPlanVersion attributes to be returned in the result
* @param {string[]} testPlanReportAttributes - TestPlanReport attributes to be returned in the result
* @param {string[]} atAttributes - AT attributes to be returned in the result
* @param {string[]} atVersionAttributes - AT version attributes to be returned in the result
* @param {string[]} browserAttributes - Browser attributes to be returned in the result
* @param {string[]} browserVersionAttributes - Browser version attributes to be returned in the result
* @param {string[]} testPlanRunAttributes - TestPlanRun attributes to be returned in the result
* @param {string[]} userAttributes - User attributes to be returned in the result
* @param {object} options - Generic options for Sequelize
Expand All @@ -287,9 +259,7 @@ const updateTestPlanVersion = async (
testPlanVersionAttributes = TEST_PLAN_VERSION_ATTRIBUTES,
testPlanReportAttributes = TEST_PLAN_REPORT_ATTRIBUTES,
atAttributes = AT_ATTRIBUTES,
atVersionAttributes = AT_VERSION_ATTRIBUTES,
browserAttributes = BROWSER_ATTRIBUTES,
browserVersionAttributes = BROWSER_VERSION_ATTRIBUTES,
testPlanRunAttributes = TEST_PLAN_RUN_ATTRIBUTES,
userAttributes = USER_ATTRIBUTES,
options = {}
Expand All @@ -315,9 +285,7 @@ const updateTestPlanVersion = async (
testPlanVersionAttributes,
testPlanReportAttributes,
atAttributes,
atVersionAttributes,
browserAttributes,
browserVersionAttributes,
testPlanRunAttributes,
userAttributes,
options
Expand Down Expand Up @@ -412,7 +380,6 @@ const getTestPlans = async ({
undefined,
undefined,
undefined,
undefined,
testPlanVersionOrder ? { order: testPlanVersionOrder } : undefined
);
testPlans = testPlans.map(testPlan => {
Expand Down
2 changes: 0 additions & 2 deletions server/resolvers/testPlanVersionsResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const testPlanVersionsResolver = async (root, args, context, info) => {
[],
[],
[],
[],
[],
{
order: [
['updatedAt', 'desc'],
Expand Down
4 changes: 0 additions & 4 deletions server/tests/models/services/TestPlanVersionService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ describe('TestPlanReportModel Data Checks', () => {
[],
[],
[],
[],
[],
[]
);
const {
Expand Down Expand Up @@ -187,8 +185,6 @@ describe('TestPlanReportModel Data Checks', () => {
[],
[],
[],
[],
[],
{
enablePagination: true
}
Expand Down

0 comments on commit a9450fb

Please sign in to comment.