Skip to content

Commit

Permalink
[#674] Add support for introspective Variant in UI and CMD
Browse files Browse the repository at this point in the history
So that users can input variant=introspective
- add introspective to variant enum
- make sure web app understand the introspective variant
  • Loading branch information
philou authored and mengdaming committed Oct 1, 2024
1 parent a9ebac2 commit e143784
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/variant/variant.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func (v Variant) Name() string {
}

const (
Relaxed Variant = "relaxed"
BTCR Variant = "btcr"
Relaxed Variant = "relaxed"
BTCR Variant = "btcr"
Introspective Variant = "introspective"
)
1 change: 1 addition & 0 deletions src/variant/variant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func Test_get_variant_name(t *testing.T) {
}{
{"relaxed", Relaxed, "relaxed"},
{"btcr", BTCR, "btcr"},
{"introspective", Introspective, "introspective"},
}

for _, test := range tests {
Expand Down
4 changes: 4 additions & 0 deletions webapp/src/app/interfaces/tcr-session-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@ export const tcrVariants: { [key: string]: TcrVariant } = {
description: "The Relaxed",
statechartImageFile: "variant-relaxed.png",
},
"introspective": {
description: "The Introspective",
statechartImageFile: "variant-introspective.png",
},
};
1 change: 1 addition & 0 deletions webapp/src/app/pipes/variant-description.pipe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('VariantDescriptionPipe', () => {
{input: 'relaxed', expected: 'The Relaxed'},
{input: 'btcr', expected: 'BTCR -- Build && Test && Commit || Revert'},
{input: 'original', expected: 'The Original'},
{input: 'introspective', expected: 'The Introspective'},
{input: null, expected: notSet},
{input: undefined, expected: notSet},
{input: '', expected: notSet}
Expand Down
1 change: 1 addition & 0 deletions webapp/src/app/pipes/variant-image-path.pipe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe('VariantImagePathPipe', () => {
{input: 'relaxed', expected: 'assets/images/variant-relaxed.png'},
{input: 'btcr', expected: 'assets/images/variant-btcr.png'},
{input: 'original', expected: 'assets/images/variant-original.png'},
{input: 'introspective', expected: 'assets/images/variant-introspective.png'},
{input: null, expected: ''},
{input: undefined, expected: ''},
{input: '', expected: ''}
Expand Down

0 comments on commit e143784

Please sign in to comment.