-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #576 from Opetushallitus/OK-471-osaamismerkki-vst-…
…toteutuksille Ok 471 osaamismerkki vst toteutuksille
- Loading branch information
Showing
31 changed files
with
4,354 additions
and
1,901 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
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
175 changes: 175 additions & 0 deletions
175
src/main/app/src/pages/koulutus/KoulutusForm/TiedotSection/Osaamismerkki.test.ts
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,175 @@ | ||
import { updateOptionsWithMaybeDeprecatedOsaamismerkki } from './OsaamismerkkiField'; | ||
|
||
describe('updateOptionsWithMaybeDeprecatedOsaamismerkki', () => { | ||
test('should return new options array with deprecated osaamismerkki value and label', () => { | ||
const options = [ | ||
{ | ||
value: 'osaamismerkit_1009#1', | ||
label: 'Arjen rahankäyttö', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1028#1', | ||
label: 'Digiosaamisen kehittäminen', | ||
}, | ||
]; | ||
|
||
const osaamismerkki = { | ||
id: 9202930, | ||
koodiUri: 'osaamismerkit_1011', | ||
nimi: { | ||
_id: '9204039', | ||
_tunniste: '19734f54-f4b4-43a6-ba0b-27d150463736', | ||
fi: 'Mittayksiköt', | ||
sv: 'Måttenheter', | ||
}, | ||
voimassaoloAlkaa: 1704060000000, | ||
voimassaoloLoppuu: 1727643600000, | ||
}; | ||
|
||
const result = [ | ||
{ | ||
value: 'osaamismerkit_1009#1', | ||
label: 'Arjen rahankäyttö', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1028#1', | ||
label: 'Digiosaamisen kehittäminen', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1011#1', | ||
label: 'Mittayksiköt', | ||
}, | ||
]; | ||
|
||
expect( | ||
updateOptionsWithMaybeDeprecatedOsaamismerkki( | ||
options, | ||
'osaamismerkit_1011#1', | ||
osaamismerkki, | ||
'fi' | ||
) | ||
).toEqual(result); | ||
}); | ||
|
||
test('should not update options if osaamismerkkiId is not defined', () => { | ||
const options = [ | ||
{ | ||
value: 'osaamismerkit_1009#1', | ||
label: 'Arjen rahankäyttö', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1028#1', | ||
label: 'Digiosaamisen kehittäminen', | ||
}, | ||
]; | ||
|
||
const osaamismerkki = undefined; | ||
|
||
const result = [ | ||
{ | ||
value: 'osaamismerkit_1009#1', | ||
label: 'Arjen rahankäyttö', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1028#1', | ||
label: 'Digiosaamisen kehittäminen', | ||
}, | ||
]; | ||
|
||
expect( | ||
updateOptionsWithMaybeDeprecatedOsaamismerkki( | ||
options, | ||
undefined, | ||
osaamismerkki, | ||
'fi' | ||
) | ||
).toEqual(result); | ||
}); | ||
|
||
test('should not update options if osaamismerkin nimi is not defined', () => { | ||
const options = [ | ||
{ | ||
value: 'osaamismerkit_1009#1', | ||
label: 'Arjen rahankäyttö', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1028#1', | ||
label: 'Digiosaamisen kehittäminen', | ||
}, | ||
]; | ||
|
||
const result = [ | ||
{ | ||
value: 'osaamismerkit_1009#1', | ||
label: 'Arjen rahankäyttö', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1028#1', | ||
label: 'Digiosaamisen kehittäminen', | ||
}, | ||
]; | ||
|
||
expect( | ||
updateOptionsWithMaybeDeprecatedOsaamismerkki( | ||
options, | ||
'osaamismerkit_1011#1', | ||
undefined, | ||
'fi' | ||
) | ||
).toEqual(result); | ||
}); | ||
|
||
test('should not update options if osaamismerkki already exists in options', () => { | ||
const options = [ | ||
{ | ||
value: 'osaamismerkit_1009#1', | ||
label: 'Arjen rahankäyttö', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1028#1', | ||
label: 'Digiosaamisen kehittäminen', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1011#1', | ||
label: 'Mittayksiköt', | ||
}, | ||
]; | ||
|
||
const osaamismerkki = { | ||
id: 9202930, | ||
koodiUri: 'osaamismerkit_1011', | ||
nimi: { | ||
_id: '9204039', | ||
_tunniste: '19734f54-f4b4-43a6-ba0b-27d150463736', | ||
fi: 'Mittayksiköt', | ||
sv: 'Måttenheter', | ||
}, | ||
voimassaoloAlkaa: 1704060000000, | ||
voimassaoloLoppuu: 1727643600000, | ||
}; | ||
|
||
const result = [ | ||
{ | ||
value: 'osaamismerkit_1009#1', | ||
label: 'Arjen rahankäyttö', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1028#1', | ||
label: 'Digiosaamisen kehittäminen', | ||
}, | ||
{ | ||
value: 'osaamismerkit_1011#1', | ||
label: 'Mittayksiköt', | ||
}, | ||
]; | ||
|
||
expect( | ||
updateOptionsWithMaybeDeprecatedOsaamismerkki( | ||
options, | ||
'osaamismerkit_1011#1', | ||
osaamismerkki, | ||
'fi' | ||
) | ||
).toEqual(result); | ||
}); | ||
}); |
Oops, something went wrong.