summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/tests/stacks.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/code-modernization/tests/stacks.test.ts')
-rw-r--r--plugins/code-modernization/tests/stacks.test.ts22
1 files changed, 21 insertions, 1 deletions
diff --git a/plugins/code-modernization/tests/stacks.test.ts b/plugins/code-modernization/tests/stacks.test.ts
index 377c8b55..8dcee2f9 100644
--- a/plugins/code-modernization/tests/stacks.test.ts
+++ b/plugins/code-modernization/tests/stacks.test.ts
@@ -4,7 +4,7 @@ import { tilesOf } from '../hooks/map/estate'
import { discoverEstate } from '../hooks/reader/discover'
import { xrayOf } from '../hooks/xray/xray'
import { readNotes, stateOfUplift, totalsOfTrx } from '../hooks/reader/modernized'
-import { oneLineOf, readSnapshot, type ReadOptions, type Snapshot } from '../hooks/reader/progress'
+import { oneLineOf, readSnapshot, systemsOf, type ReadOptions, type Snapshot } from '../hooks/reader/progress'
import { changedPathsOf, parseBaseline, parseCatalog } from '../hooks/reader/uplift'
import { pickTrack } from '../hooks/reader/tracks'
import { BAND, command, HINT, PANE, SESSION } from './fixtures/inputs'
@@ -161,6 +161,26 @@ describe('uplift, whatever the stack', () => {
expect(changedPathsOf(before, before)).toEqual([])
})
+ test('only systems the workflows would accept are listed, so a name from the tree never reaches a command or a note', async () => {
+ const fs = memoryFs({
+ 'legacy/shop/a.java': 'x',
+ 'legacy/my system/a.java': 'x',
+ 'legacy/a;rm -rf/a.java': 'x',
+ 'analysis/-flag/a.md': 'x',
+ 'analysis/billing/a.md': 'x',
+ 'legacy/.hidden/a.java': 'x',
+ })
+
+ expect(await systemsOf(fs)).toEqual(['billing', 'shop'])
+ })
+
+ test('a module id that is not one plain token is never put in a command', async () => {
+ const files = { ...MAVEN_UPLIFT }
+ const snapshot = await read(files)
+
+ expect(snapshot.next?.text ?? '').not.toContain('$(')
+ })
+
test('the newest track is the one followed, and a named one is pinned', () => {
expect(pickTrack('auto', { transformAt: 5, upliftAt: 9, reimagineAt: null })).toBe('uplift')
expect(pickTrack('auto', { transformAt: 12, upliftAt: 9, reimagineAt: 3 })).toBe('transform')