mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
Update prettier to latest. Remove tslint (#1641)
* Rev up prettier * Reformat * Remove deprecated tslint * Remove call to tslint and update package-lock.json
This commit is contained in:
@@ -50,12 +50,12 @@ interface Props {
|
||||
export const AccountSwitcher: FunctionComponent<Props> = ({ armToken, setDatabaseAccount }: Props) => {
|
||||
const subscriptions = useSubscriptions(armToken);
|
||||
const [selectedSubscriptionId, setSelectedSubscriptionId] = useState<string>(() =>
|
||||
localStorage.getItem("cachedSubscriptionId")
|
||||
localStorage.getItem("cachedSubscriptionId"),
|
||||
);
|
||||
const selectedSubscription = subscriptions?.find((sub) => sub.subscriptionId === selectedSubscriptionId);
|
||||
const accounts = useDatabaseAccounts(selectedSubscription?.subscriptionId, armToken);
|
||||
const [selectedAccountName, setSelectedAccountName] = useState<string>(() =>
|
||||
localStorage.getItem("cachedDatabaseAccountName")
|
||||
localStorage.getItem("cachedDatabaseAccountName"),
|
||||
);
|
||||
const selectedAccount = accounts?.find((account) => account.name === selectedAccountName);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ it("switches tenant for user", () => {
|
||||
tenantId="test1-id"
|
||||
switchTenant={switchTenant}
|
||||
dismissPanel={dismissPanel}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
fireEvent.click(screen.getByLabelText(/test2-id/));
|
||||
expect(switchTenant).toHaveBeenCalledWith(directories[1].tenantId);
|
||||
|
||||
@@ -7,7 +7,7 @@ describe("ConnectionStringParser", () => {
|
||||
|
||||
it("should parse a valid sql account connection string", () => {
|
||||
const metadata = parseConnectionString(
|
||||
`AccountEndpoint=https://${mockAccountName}.documents.azure.com:443/;AccountKey=${mockMasterKey};`
|
||||
`AccountEndpoint=https://${mockAccountName}.documents.azure.com:443/;AccountKey=${mockMasterKey};`,
|
||||
);
|
||||
|
||||
expect(metadata.accountName).toBe(mockAccountName);
|
||||
@@ -16,7 +16,7 @@ describe("ConnectionStringParser", () => {
|
||||
|
||||
it("should parse a valid mongo account connection string", () => {
|
||||
const metadata = parseConnectionString(
|
||||
`mongodb://${mockAccountName}:${mockMasterKey}@${mockAccountName}.documents.azure.com:10255`
|
||||
`mongodb://${mockAccountName}:${mockMasterKey}@${mockAccountName}.documents.azure.com:10255`,
|
||||
);
|
||||
|
||||
expect(metadata.accountName).toBe(mockAccountName);
|
||||
@@ -25,7 +25,7 @@ describe("ConnectionStringParser", () => {
|
||||
|
||||
it("should parse a valid compute mongo account connection string", () => {
|
||||
const metadata = parseConnectionString(
|
||||
`mongodb://${mockAccountName}:${mockMasterKey}@${mockAccountName}.mongo.cosmos.azure.com:10255`
|
||||
`mongodb://${mockAccountName}:${mockMasterKey}@${mockAccountName}.mongo.cosmos.azure.com:10255`,
|
||||
);
|
||||
|
||||
expect(metadata.accountName).toBe(mockAccountName);
|
||||
@@ -34,7 +34,7 @@ describe("ConnectionStringParser", () => {
|
||||
|
||||
it("should parse a valid graph account connection string", () => {
|
||||
const metadata = parseConnectionString(
|
||||
`AccountEndpoint=https://${mockAccountName}.documents.azure.com:443/;AccountKey=${mockMasterKey};ApiKind=Gremlin;`
|
||||
`AccountEndpoint=https://${mockAccountName}.documents.azure.com:443/;AccountKey=${mockMasterKey};ApiKind=Gremlin;`,
|
||||
);
|
||||
|
||||
expect(metadata.accountName).toBe(mockAccountName);
|
||||
@@ -43,7 +43,7 @@ describe("ConnectionStringParser", () => {
|
||||
|
||||
it("should parse a valid table account connection string", () => {
|
||||
const metadata = parseConnectionString(
|
||||
`DefaultEndpointsProtocol=https;AccountName=${mockAccountName};AccountKey=${mockMasterKey};TableEndpoint=https://${mockAccountName}.table.cosmosdb.azure.com:443/;`
|
||||
`DefaultEndpointsProtocol=https;AccountName=${mockAccountName};AccountKey=${mockMasterKey};TableEndpoint=https://${mockAccountName}.table.cosmosdb.azure.com:443/;`,
|
||||
);
|
||||
|
||||
expect(metadata.accountName).toBe(mockAccountName);
|
||||
@@ -52,7 +52,7 @@ describe("ConnectionStringParser", () => {
|
||||
|
||||
it("should parse a valid cassandra account connection string", () => {
|
||||
const metadata = parseConnectionString(
|
||||
`AccountEndpoint=${mockAccountName}.cassandra.cosmosdb.azure.com;AccountKey=${mockMasterKey};`
|
||||
`AccountEndpoint=${mockAccountName}.cassandra.cosmosdb.azure.com;AccountKey=${mockMasterKey};`,
|
||||
);
|
||||
|
||||
expect(metadata.accountName).toBe(mockAccountName);
|
||||
|
||||
@@ -31,8 +31,8 @@ describe("hasFlag", () => {
|
||||
expect(hasFlag(singleFlagValue, desiredFlag)).toBe(true);
|
||||
expect(hasFlag(multipleFlagValues, desiredFlag)).toBe(true);
|
||||
expect(hasFlag(differentFlagValue, desiredFlag)).toBe(false);
|
||||
expect(hasFlag(multipleFlagValues, (undefined as unknown) as string)).toBe(false);
|
||||
expect(hasFlag((undefined as unknown) as string, desiredFlag)).toBe(false);
|
||||
expect(hasFlag((undefined as unknown) as string, (undefined as unknown) as string)).toBe(false);
|
||||
expect(hasFlag(multipleFlagValues, undefined as unknown as string)).toBe(false);
|
||||
expect(hasFlag(undefined as unknown as string, desiredFlag)).toBe(false);
|
||||
expect(hasFlag(undefined as unknown as string, undefined as unknown as string)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user