Skip to content

Commit

Permalink
Fixes style for disabled buttons and formats code style
Browse files Browse the repository at this point in the history
  • Loading branch information
latin-panda committed Jan 29, 2025
1 parent 372d8b8 commit 105c6e4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
1 change: 0 additions & 1 deletion packages/scenario/src/answer/RankValuesAnswer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { ComparableAnswer } from './ComparableAnswer.ts';
* as part of a test's "act" phase.
*/
export class RankValuesAnswer extends ComparableAnswer {

readonly stringValue: string;

constructor(readonly values: readonly string[]) {
Expand Down
11 changes: 8 additions & 3 deletions packages/scenario/src/jr/Scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ type AnswerParameters =
| readonly [reference: string, value: unknown]
| readonly [value: unknown];

const isAnswerItemCollectionParams = (args: AnswerParameters): args is AnswerItemCollectionParameters => {
const isAnswerItemCollectionParams = (
args: AnswerParameters
): args is AnswerItemCollectionParameters => {
return args.length > 2 && args.every((arg) => typeof arg === 'string');
};

Expand Down Expand Up @@ -380,7 +382,10 @@ export class Scenario {
return this.setNonTerminalEventPosition(() => index, reference);
}

private answerItemCollectionQuestion(reference: string, ...selectionValues: string[]): ValueNodeAnswer {
private answerItemCollectionQuestion(
reference: string,
...selectionValues: string[]
): ValueNodeAnswer {
const event = this.setPositionalStateToReference(reference);
const isSelect = isQuestionEventOfType(event, 'select');
const isRank = isQuestionEventOfType(event, 'rank');
Expand All @@ -391,7 +396,7 @@ export class Scenario {
);
}

if(isRank) {
if (isRank) {
return event.answerQuestion(new RankValuesAnswer(selectionValues));
}

Expand Down
12 changes: 2 additions & 10 deletions packages/scenario/test/rank.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ describe('Rank', () => {
)
)
),
body(
rank(
'/data/rankQuestion',
"instance('options')/root/item"
)
)
body(rank('/data/rankQuestion', "instance('options')/root/item"))
);
};

Expand All @@ -59,10 +54,7 @@ describe('Rank', () => {
)
),
body(
selectDynamic(
'/data/selectQuestion',
"instance('options')/root/item"
),
selectDynamic('/data/selectQuestion', "instance('options')/root/item"),

rank(
'/data/rankQuestion',
Expand Down
6 changes: 5 additions & 1 deletion packages/web-forms/src/components/controls/RankControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ const swapItems = (index: number, newPosition: number) => {
}
button:disabled {
background: var(--surface-200);
background: var(--surface-100);
border: none;
svg path {
fill: var(--surface-300);
}
}
}
Expand Down

0 comments on commit 105c6e4

Please sign in to comment.