Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 28 additions & 75 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"date-fns": "^3.6.0",
"formik": "^2.4.6",
"lucide-react": "^0.542.0",
"react": "^19.1.1",
"react": "^19.2.0",
"react-chartjs-2": "^5.3.0",
"react-dom": "^19.1.1",
"react-dom": "^19.2.0",
"react-redux": "^9.1.2",
"react-router": "^7.8.0",
"sonner": "^2.0.7",
Expand All @@ -73,7 +73,7 @@
"@types/jest": "^29.5.14",
"@types/loadable__component": "^5.13.10",
"@types/node": "^18.19.122",
"@types/react": "^19.1.11",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.1.7",
"@types/react-redux": "^7.1.34",
"@types/react-router-dom": "^5.3.3",
Expand Down
6 changes: 5 additions & 1 deletion ui/src/app/flags/rollouts/Rollouts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ export default function Rollouts({ flag, rollouts }: RolloutsProps) {
items={rollouts.map((rollout) => rollout.id!)}
strategy={verticalListSortingStrategy}
>
<ul role="list" className="flex-col space-y-6 p-2 md:flex">
<ul
role="list"
data-testid="rollouts"
className="flex-col space-y-6 p-2 md:flex"
>
{rollouts &&
rollouts.map((rollout, index) => (
<SortableRollout
Expand Down
1 change: 1 addition & 0 deletions ui/src/app/flags/rules/Rules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export default function Rules({ flag, variants, rules }: RulesProps) {
>
<ul
role="list"
data-testid="rules"
className="flex-col space-y-6 p-2 md:flex"
>
{rules &&
Expand Down
25 changes: 16 additions & 9 deletions ui/tests/rollouts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,24 @@ test.describe('Rollouts', () => {
// Wait for rollouts to be visible before attempting drag
await page.getByTestId('rollout-0').waitFor();
await page.getByTestId('rollout-1').waitFor();

await page
const rollout0 = page
.getByTestId('rollout-0')
.getByRole('button', { name: 'Rollout' })
.first()
.dragTo(
page
.getByTestId('rollout-1')
.getByRole('button', { name: 'Rollout' })
.first()
);
.first();

const rolloutBox = (await rollout0.boundingBox()) || {
x: 0,
y: 0,
height: 0,
wihth: 0
};

await rollout0.dragTo(page.getByTestId('rollouts').first(), {
targetPosition: {
x: rolloutBox.x,
y: rolloutBox.y + rolloutBox.height + 10
}
});
await page.getByRole('button', { name: 'Update' }).click();
await expect(page.getByText('Successfully updated flag')).toBeVisible();
await expect(
Expand Down
19 changes: 13 additions & 6 deletions ui/tests/rules.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,21 @@ test.describe('Rules', () => {
// Wait for rules to be visible before attempting drag
await page.getByTestId('rule-0').waitFor();
await page.getByTestId('rule-1').waitFor();

await page
const rule1 = page
.getByTestId('rule-1')
.getByRole('button', { name: 'Rule' })
.first()
.dragTo(
page.getByTestId('rule-0').getByRole('button', { name: 'Rule' }).first()
);
.first();

const ruleBox = (await rule1.boundingBox()) || {
x: 0,
y: 0,
width: 0,
height: 0
};

await rule1.dragTo(page.getByTestId('rules').first(), {
targetPosition: { x: ruleBox.x, y: ruleBox.y - ruleBox.height - 10 }
});
await page.getByRole('button', { name: 'Update' }).click();
await expect(page.getByText('Successfully updated flag')).toBeVisible();
await expect(
Expand Down
Loading