Skip to content

Commit

Permalink
Move file uploader basic stories to proper folder (#5352)
Browse files Browse the repository at this point in the history
  • Loading branch information
epfeiffe authored Jan 6, 2025
1 parent a815e8c commit fd9d169
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';
import { FileUploader } from '..';

import { FileUploaderBasic } from '..';

export function Scenario() {
return <FileUploader />;
return <FileUploaderBasic disabled />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';

import { FileUploader } from '..';
import { FileUploaderBasic } from '..';

export function Scenario() {
return (
<FileUploader
<FileUploaderBasic
progressAmount={40}
progressMessage="Uploading... 8.24 of 45.08MB"
errorMessage="Upload failed... connection was lost."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';

import { FileUploader } from '..';
import { FileUploaderBasic } from '..';

export function Scenario() {
return (
<React.Fragment>
<FileUploader progressMessage="uploading..." progressAmount={40} />
<FileUploaderBasic progressMessage="uploading..." progressAmount={40} />
</React.Fragment>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';

import { FileUploader } from '..';
import { FileUploaderBasic } from '..';

export function Scenario() {
return (
<React.Fragment>
<FileUploader />
<FileUploaderBasic />
</React.Fragment>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';

import { FileUploader } from '..';
import { FileUploaderBasic } from '..';

export function Scenario() {
return <FileUploader progressAmount={40} progressMessage="Uploading... 8.24 of 45.08MB" />;
return <FileUploaderBasic progressAmount={40} progressMessage="Uploading... 8.24 of 45.08MB" />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';

import { FileUploader } from '..';
import { FileUploaderBasic } from '..';

export function Scenario() {
return <FileUploader progressMessage="Uploading... hang tight." />;
return <FileUploaderBasic progressMessage="Uploading... hang tight." />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ LICENSE file in the root directory of this source tree.
import { expect, test } from '@playwright/test';
import { mount, analyzeAccessibility } from '../../test/integration';

test.describe('file-uploader', () => {
test.describe('file-uploader-basic', () => {
test('pre-drop passes basic a11y tests', async ({ page }) => {
await mount(page, 'file-uploader--pre-drop');
await mount(page, 'file-uploader-basic--pre-drop');
const accessibilityReport = await analyzeAccessibility(page);

expect(accessibilityReport).toHaveNoAccessibilityIssues();
});

test('post-drop passes basic a11y tests', async ({ page }) => {
await mount(page, 'file-uploader--post-drop');
await mount(page, 'file-uploader-basic--post-drop');
const accessibilityReport = await analyzeAccessibility(page);

expect(accessibilityReport).toHaveNoAccessibilityIssues();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';

import { FileUploader } from '..';
import { FileUploaderBasic } from '..';

export function Scenario() {
return <FileUploader disabled />;
return <FileUploaderBasic />;
}
22 changes: 22 additions & 0 deletions src/file-uploader-basic/__tests__/file-uploader-basic.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Copyright (c) Uber Technologies, Inc.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import { Scenario as FileUploaderBasicDisabled } from './file-uploader-basic-disabled.scenario';
import { Scenario as FileUploaderBasicError } from './file-uploader-basic-error.scenario';
import { Scenario as FileUploaderBasicPostDrop } from './file-uploader-basic-post-drop.scenario';
import { Scenario as FileUploaderBasicPreDrop } from './file-uploader-basic-pre-drop.scenario';
import { Scenario as FileUploaderBasicProgressBar } from './file-uploader-basic-progress-bar.scenario';
import { Scenario as FileUploaderBasicSpinner } from './file-uploader-basic-spinner.scenario';
import { Scenario as FileUploaderBasicDefault } from './file-uploader-basic.scenario';

export const Disabled = () => <FileUploaderBasicDisabled />;
export const Error = () => <FileUploaderBasicError />;
export const PostDrop = () => <FileUploaderBasicPostDrop />;
export const PreDrop = () => <FileUploaderBasicPreDrop />;
export const ProgressBar = () => <FileUploaderBasicProgressBar />;
export const Spinner = () => <FileUploaderBasicSpinner />;
export const FileUploader = () => <FileUploaderBasicDefault />;
22 changes: 0 additions & 22 deletions src/file-uploader/__tests__/file-uploader.stories.tsx

This file was deleted.

1 change: 1 addition & 0 deletions src/file-uploader/__tests__/file-uploader.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/*
Copyright (c) Uber Technologies, Inc.
Expand Down

0 comments on commit fd9d169

Please sign in to comment.