Skip to content
310 changes: 310 additions & 0 deletions web/packages/design/src/ResourceIcon/assets/laptop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions web/packages/design/src/ResourceIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import gcp from './assets/gcp.svg';
import grafana from './assets/grafana.svg';
import jenkins from './assets/jenkins.svg';
import kube from './assets/kube.svg';
import laptop from './assets/laptop.svg';
import linuxDark from './assets/linux-dark.svg';
import linuxLight from './assets/linux-light.svg';
import mongoDark from './assets/mongo-dark.svg';
Expand Down Expand Up @@ -91,6 +92,7 @@ const iconSpecs = {
Grafana: forAllThemes(grafana),
Jenkins: forAllThemes(jenkins),
Kube: forAllThemes(kube),
Laptop: forAllThemes(laptop),
Linux: { dark: linuxDark, light: linuxLight },
Mongo: { dark: mongoDark, light: mongoLight },
MysqlLarge: { dark: mysqlLargeDark, light: mysqlLargeLight },
Expand Down
22 changes: 16 additions & 6 deletions web/packages/teleport/src/Discover/Discover.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@ import { makeDefaultUserPreferences } from 'teleport/services/userPreferences/us

import { ResourceKind } from './Shared';

beforeEach(() => {
jest.restoreAllMocks();
});

type createProps = {
initialEntry?: string;
preferredResource?: ClusterResource;
};

const create = ({ initialEntry = '', preferredResource }: createProps) => {
jest.spyOn(window.navigator, 'userAgent', 'get').mockReturnValue('Macintosh');

const defaultPref = makeDefaultUserPreferences();
defaultPref.onboard.preferredResources = preferredResource
? [preferredResource]
Expand Down Expand Up @@ -83,9 +89,11 @@ const create = ({ initialEntry = '', preferredResource }: createProps) => {
test('displays all resources by default', () => {
create({});

expect(screen.getAllByTestId(ResourceKind.Server)).toHaveLength(
SERVERS.length
);
expect(
screen.getAllByTestId(ResourceKind.Server)
// TODO(ravicious): Uncomment for v14.2.
// .concat(screen.getAllByTestId(ResourceKind.ConnectMyComputer))
).toHaveLength(SERVERS.length);
expect(screen.getAllByTestId(ResourceKind.Desktop)).toHaveLength(
WINDOWS_DESKTOPS.length
);
Expand Down Expand Up @@ -122,9 +130,11 @@ describe('location state', () => {
test('displays servers when the location state is server', () => {
create({ initialEntry: 'server' });

expect(screen.getAllByTestId(ResourceKind.Server)).toHaveLength(
SERVERS.length
);
expect(
screen.getAllByTestId(ResourceKind.Server)
// TODO(ravicious): Uncomment for v14.2.
// .concat(screen.getAllByTestId(ResourceKind.ConnectMyComputer))
).toHaveLength(SERVERS.length);

// we assert three databases for servers because the naming convention includes "server"
expect(screen.queryAllByTestId(ResourceKind.Database)).toHaveLength(3);
Expand Down
Loading