-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mapping of group names when name contains group type
The mapping logic expected all entries in the `CHAIR_W3CID` variable to use abbreviated group types such as `CG` instead of `Community Group`.
- Loading branch information
Showing
3 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { initTestEnv } from './init-test-env.mjs'; | ||
import { getEnvKey, setEnvKey } from '../tools/lib/envkeys.mjs'; | ||
import { fetchProject } from '../tools/lib/project.mjs'; | ||
import { validateSession } from '../tools/lib/validate.mjs'; | ||
import * as assert from 'node:assert'; | ||
|
||
async function fetchTestProject() { | ||
return fetchProject( | ||
await getEnvKey('PROJECT_OWNER'), | ||
await getEnvKey('PROJECT_NUMBER')); | ||
} | ||
|
||
describe('Validation of unknown groups', function () { | ||
before(function () { | ||
initTestEnv(); | ||
setEnvKey('PROJECT_NUMBER', 'group-unknown'); | ||
setEnvKey('ISSUE_TEMPLATE', 'test/data/template-group.yml'); | ||
}); | ||
|
||
it('takes mapping into account regardless of type abbreviation (BG -> Business Group)', async function () { | ||
const project = await fetchTestProject(); | ||
project.chairsToW3CID = { 'The Super Business Group': -1 }; | ||
const sessionNumber = 1; | ||
const errors = await validateSession(sessionNumber, project); | ||
assert.deepStrictEqual(errors, []); | ||
}); | ||
|
||
it('takes mapping into account regardless of type abbreviation (BG -> BG)', async function () { | ||
const project = await fetchTestProject(); | ||
project.chairsToW3CID = { 'The Super BG': 'ok' }; | ||
const sessionNumber = 1; | ||
const errors = await validateSession(sessionNumber, project); | ||
assert.deepStrictEqual(errors, []); | ||
}); | ||
|
||
it('takes mapping into account regardless of type abbreviation (Working Group -> Working Group)', async function () { | ||
const project = await fetchTestProject(); | ||
project.chairsToW3CID = { 'the not heavily working group': 'lazy' }; | ||
const sessionNumber = 2; | ||
const errors = await validateSession(sessionNumber, project); | ||
assert.deepStrictEqual(errors, []); | ||
}); | ||
|
||
it('takes mapping into account regardless of type abbreviation (Working Group -> WG)', async function () { | ||
const project = await fetchTestProject(); | ||
project.chairsToW3CID = { 'the not heavily WG': -1 }; | ||
const sessionNumber = 2; | ||
const errors = await validateSession(sessionNumber, project); | ||
assert.deepStrictEqual(errors, []); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default { | ||
description: 'meeting: Mapping of unknown group names, timezone: Etc/UTC, type: groups', | ||
|
||
sessions: [ | ||
{ | ||
number: 1, | ||
title: 'The Super BG' | ||
}, | ||
|
||
{ | ||
number: 2, | ||
title: 'The Not Heavily Working Group' | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters