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
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ test.describe(`${TAG.FUNCTIONAL} `, () => {

await expect(locators.trigger(page)).toBeFocused();

await expect(locators.triggerText(page)).toHaveText('Com.: 2-7');
await expect(locators.triggerText(page)).toHaveText('Com.: 27');
});

await test.step('Verify hint on close button and trigger keyboard navigation', async () => {
Expand Down Expand Up @@ -166,7 +166,7 @@ test.describe(`${TAG.FUNCTIONAL} `, () => {
await locators.textbox(page).nth(1).fill('8');
await locators.button(page, 'Apply').click();
await locators.button(page, 'Apply').waitFor({ state: 'hidden' });
await expect(locators.triggerText(page)).toHaveText('Com.: 1-8');
await expect(locators.triggerText(page)).toHaveText('Com.: 18');
await expect(locators.button(page, 'Clear')).toBeVisible();
});

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ test.describe(TAG.FUNCTIONAL, () => {
await locators.popper(page).waitFor({ state: 'hidden' });

await expect(locators.trigger(page)).toBeFocused();
await expect(locators.trigger(page)).toHaveText(/Volume:\s*1,001-10,000/);
await expect(locators.trigger(page)).toHaveText(/Volume:\s*1,00110,000/);
});

await test.step('Verify hint on close button and trigger keyboard navigation', async () => {
Expand Down Expand Up @@ -177,7 +177,7 @@ test.describe(TAG.FUNCTIONAL, () => {
await page.keyboard.press('Tab');
await page.keyboard.press('Enter');
await locators.popper(page).waitFor({ state: 'hidden' });
await expect(locators.trigger(page)).toHaveText(/Volume:\s*1-5+/);
await expect(locators.trigger(page)).toHaveText(/Volume:\s*15+/);
});
});

Expand All @@ -200,7 +200,7 @@ test.describe(TAG.FUNCTIONAL, () => {
await locators.popper(page).waitFor({ state: 'hidden' });

await expect(locators.popper(page)).toBeHidden();
await expect(locators.trigger(page)).toHaveText(/Volume:\s*1,001-10,000/);
await expect(locators.trigger(page)).toHaveText(/Volume:\s*1,00110,000/);
await expect(locators.filterTriggerClear(page)).toHaveCount(1);
});

Expand Down Expand Up @@ -231,7 +231,7 @@ test.describe(TAG.FUNCTIONAL, () => {
await locators.textboxes(page).nth(1).fill('5');
await locators.apply(page).click();
await locators.popper(page).waitFor({ state: 'hidden' });
await expect(locators.trigger(page)).toHaveText(/Volume:\s*1-5/);
await expect(locators.trigger(page)).toHaveText(/Volume:\s*15/);
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const InputRange: React.FC<InputRangeProps> = ({ value: valueState, changeValue,

const setTriggerText = ({ from, to }: { from: string; to: string }): string | null => {
if (from !== '' && to !== '') {
return from === to ? `${from}` : `${from}-${to}`;
return from === to ? `${from}` : `${from}${to}`;
}
return null;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const Demo = () => {
</Select.Trigger>
<Select.Popper w={224} aria-label='Volume'>
<Select.List aria-label='Presets'>
{['100,001+', '10,001-100,000', '1,001-10,000', '101-1,000', '11-100', '1-10'].map(
{['100,001+', '10,001100,000', '1,00110,000', '1011,000', '11100', '110'].map(
(item) => (
<Select.Option key={item} value={item}>
{item}
Expand Down
6 changes: 3 additions & 3 deletions website/docs/.vitepress/renderSandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ export const renderSandbox = (
tokens[idx + 1].executableCode = executableCode;
}

const encodedHtmlCode = btoa(htmlCode);
const encodedRawCode = btoa(displayedCode);
const encodedHtmlCode = Buffer.from(htmlCode).toString('base64');
const encodedRawCode = Buffer.from(displayedCode).toString('base64');

const sandboxArgs: Record<string, string | boolean> = {
playgroundId: playgroundId,
Expand All @@ -201,7 +201,7 @@ export const renderSandbox = (
};

if (mockData) {
sandboxArgs.mockData = btoa(mockData);
sandboxArgs.mockData = Buffer.from(mockData).toString('base64');
}

const args = Object.entries(sandboxArgs).reduce((acc, [key, value]) => {
Expand Down
9 changes: 6 additions & 3 deletions website/docs/.vitepress/theme/Sandbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ const dataToLzCompressedJson = (data) => {
};

const { playgroundId, htmlCode: codeEncoded, rawCode: rawCodeEncoded, hideCode: hideCodeEncoded, stylesIsolation, mockData: mockDataEncoded } = defineProps({ playgroundId: String, htmlCode: String, rawCode: String, hideCode: String, stylesIsolation: Boolean, mockData: String })

const decodeBase64 = (str: string) => new TextDecoder().decode(Uint8Array.from(atob(str), c => c.charCodeAt(0)));

const htmlCode = computed(() => {
let code = atob(codeEncoded!);
let code = decodeBase64(codeEncoded!);
return code.replace('tabindex="0" v-pre=""><code>', 'v-pre=""><code>');
});

Expand Down Expand Up @@ -116,9 +119,9 @@ root.render(<App />);
return `https://codesandbox.io/api/v1/sandboxes/define?parameters=${codesandboxParameters}`;
})

let rawCode = atob(rawCodeEncoded!);
let rawCode = decodeBase64(rawCodeEncoded!);
const hideCode = hideCodeEncoded === 'true';
const mockData = mockDataEncoded && atob(mockDataEncoded);
const mockData = mockDataEncoded && decodeBase64(mockDataEncoded);

let reactRoot;

Expand Down
Loading