Skip to content

feat: add displayLang test #5495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
14 changes: 14 additions & 0 deletions test/e2e/displayLang.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as path from "path"
import { describe, test, expect } from "./baseFixture"

// Given a code-server environment with Spanish Language Pack extension installed
// and a languagepacks.json in the data-dir
describe("--locale es", ["--extensions-dir", path.join(__dirname, "./extensions"), "--locale", "es"], {}, () => {
test("should load code-server in Spanish", async ({ codeServerPage }) => {
// When
const visible = await codeServerPage.page.isVisible("text=Explorador")

// Then
expect(visible).toBe(true)
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "vscode-language-pack-es",
"displayName": "Spanish Language Pack for Visual Studio Code",
"description": "Language pack extension for Spanish",
"version": "1.70.0",
"publisher": "MS-CEINTL",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vscode-loc"
},
"license": "SEE MIT LICENSE IN LICENSE.md",
"engines": {
"vscode": "^1.70.0"
},
"icon": "languagepack.png",
"categories": [
"Language Packs"
],
"contributes": {
"localizations": [
{
"languageId": "es",
"languageName": "Spanish",
"localizedLanguageName": "español",
"translations": [
{
"id": "vscode",
"path": "./translations/main.i18n.json"
}
]
}
]
},
"scripts": {
"update": "cd ../vscode && npm run update-localization-extension es"
},
"__metadata": {
"id": "47e020a1-33db-4cc0-a1b4-42f97781749a",
"publisherId": "0b0882c3-aee3-4d7c-b5f9-872f9be0a115",
"publisherDisplayName": null,
"targetPlatform": "undefined",
"isApplicationScoped": true,
"updated": true,
"isPreReleaseVersion": false,
"preRelease": false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"": [
"--------------------------------------------------------------------------------------------",
"Copyright (c) Microsoft Corporation. All rights reserved.",
"Licensed under the MIT License. See License.txt in the project root for license information.",
"--------------------------------------------------------------------------------------------",
"Do not edit this file. It is machine generated."
],
"version": "1.0.0",
"contents": {
"vs/base/browser/ui/actionbar/actionViewItems": {
"titleLabel": "{0} ({1})"
},
"vs/workbench/contrib/files/browser/explorerViewlet": {
"explore": "Explorador"
},
"vs/workbench/contrib/files/browser/views/explorerDecorationsProvider": {
"label": "Explorador"
},
"vs/workbench/contrib/preferences/browser/settingsLayout": {
"fileExplorer": "Explorador"
}
}
}
7 changes: 7 additions & 0 deletions test/e2e/models/CodeServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ export class CodeServer {
}),
"utf8",
)

const extensionsDir = path.join(__dirname, "../extensions")

await fs.writeFile(
path.join(dir, "languagepacks.json"),
`{"es":{"hash":"8d919a946475223861fa0c62665a4c50","extensions":[{"extensionIdentifier":{"id":"ms-ceintl.vscode-language-pack-es","uuid":"47e020a1-33db-4cc0-a1b4-42f97781749a"},"version":"1.70.0"}],"translations":{"vscode":"${extensionsDir}/ms-ceintl.vscode-language-pack-es-1.70.0/translations/main.i18n.json"},"label":"español"}}`,
)
return dir
}

Expand Down