Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ steps:
agents:
queue: workers

- name: sync-web-code
command: 'node scripts/sync-web-code.js'
if: build.branch == "master"
plugins:
'docker-compose#v3.0.3':
run: baseui
agents:
queue: workers

# vscode extension deployment disabled until we can refresh the azure token
# - name: deploy-vscode
# command: './deploy-vscode.sh'
Expand Down
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ module.exports = {
],
'import/no-duplicates': 2,
'import/newline-after-import': 2,
'jest/no-identical-title': 2,
'jest/no-focused-tests': 2,
'import/first': 2,
'dot-notation': 2,
},
Expand Down Expand Up @@ -104,7 +102,6 @@ module.exports = {
files: ['**/*.e2e.js'],
rules: {
'flowtype/require-valid-file-annotation': 'off',
'jest/no-identical-title': 'off',
},
},
{
Expand Down
62 changes: 62 additions & 0 deletions scripts/sync-web-code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
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.
*/

/* eslint-env node */
// @flow

const fetch = require('node-fetch').default;

const BUILDKITE_TASK_RUNNER_URL =
'https://api.buildkite.com/v2/organizations/uber/pipelines/web-code-task-runner/builds';

function expectEnvironmentVariable(name) {
if (!process.env[name]) {
throw new Error(`Missing environment variable: ${name}`);
}
return process.env[name];
}

async function createBuild(token, commitHash) {
const body = {
commit: 'HEAD',
message: '[baseui-sync] Triggered from CI',
meta_data: { task: 'baseui-sync' },
env: {
TASK: 'baseui-sync',
TASK_ENV: `BASEUI_OPEN_SOURCE_COMMIT=${commitHash}`,
PACKAGES: 'src/common/@uber/baseui',
},
};

const createBuildResponse = await fetch(BUILDKITE_TASK_RUNNER_URL, {
method: 'POST',
body: JSON.stringify(body),
headers: { Authorization: `Bearer ${token}` },
});

if (!createBuildResponse.ok) {
throw new Error(
`Failed to create build: ${createBuildResponse.status} ${createBuildResponse.statusText}`
);
}

const json = await createBuildResponse.json();
return json;
}

async function main() {
const token = expectEnvironmentVariable('BUILDKITE_API_TOKEN');
const commitHash = expectEnvironmentVariable('BUILDKITE_COMMIT');

const build = await createBuild(token, commitHash);
console.log(`View sync build at ${build.web_url}`);
}

main().catch((err) => {
console.error(err);
process.exit(1);
});
258 changes: 122 additions & 136 deletions src/select/__tests__/select-form-control-label-click.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,167 +35,153 @@ async function isListboxClosed(page) {
}

test.describe('select click open/close', () => {
test.describe('baseui form-control label', () => {
test.describe('non-searchable', () => {
test('label click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickLabelAtIndex(page, 0);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);

await clickLabelAtIndex(page, 0);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});

test('select click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 0);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);

await clickSelectAtIndex(page, 0);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});
});

test.describe('searchable', () => {
test('label click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickLabelAtIndex(page, 1);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);

await clickLabelAtIndex(page, 1);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});

test('select click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 1);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);

await clickSelectAtIndex(page, 1);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});
});
test('form-control non-searchable label click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickLabelAtIndex(page, 0);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);

await clickLabelAtIndex(page, 0);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});

test('form-control non-searchable select click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 0);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);

await clickSelectAtIndex(page, 0);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});

test('form-control searchable label click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickLabelAtIndex(page, 1);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);

await clickLabelAtIndex(page, 1);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});

test.describe('native label', () => {
test.describe('non-searchable', () => {
test('label click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickLabelAtIndex(page, 2);
await isListboxOpen(page);
test('form-control searchable select click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 1);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
await clickOutside(page);
await isListboxClosed(page);

await clickLabelAtIndex(page, 2);
await isListboxOpen(page);
await clickSelectAtIndex(page, 1);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});
await clickOutside(page);
await isListboxClosed(page);
});

test('select click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 2);
await isListboxOpen(page);
test('native non-searchable label click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickLabelAtIndex(page, 2);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
await clickOutside(page);
await isListboxClosed(page);

await clickSelectAtIndex(page, 2);
await isListboxOpen(page);
await clickLabelAtIndex(page, 2);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});
});
await clickOutside(page);
await isListboxClosed(page);
});

test.describe('searchable', () => {
test('label click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickLabelAtIndex(page, 3);
await isListboxOpen(page);
test('native non-searchable select click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 2);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
await clickOutside(page);
await isListboxClosed(page);

await clickLabelAtIndex(page, 3);
await isListboxOpen(page);
await clickSelectAtIndex(page, 2);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});
await clickOutside(page);
await isListboxClosed(page);
});

test('select click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 3);
await isListboxOpen(page);
test('native searchable label click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickLabelAtIndex(page, 3);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
await clickOutside(page);
await isListboxClosed(page);

await clickSelectAtIndex(page, 3);
await isListboxOpen(page);
await clickLabelAtIndex(page, 3);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});
});
await clickOutside(page);
await isListboxClosed(page);
});

test.describe('no label', () => {
test('non-searchable', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 4);
await isListboxOpen(page);
test('snative searchable elect click', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 3);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
await clickOutside(page);
await isListboxClosed(page);

await clickSelectAtIndex(page, 4);
await isListboxOpen(page);
await clickSelectAtIndex(page, 3);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});
await clickOutside(page);
await isListboxClosed(page);
});

test('no-label non-searchable', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 4);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);

await clickSelectAtIndex(page, 4);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});

test('searchable', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 5);
await isListboxOpen(page);
test('no-label searchable', async ({ page }) => {
await mount(page, 'select--searchable-form-control');
await clickSelectAtIndex(page, 5);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
await clickOutside(page);
await isListboxClosed(page);

await clickSelectAtIndex(page, 5);
await isListboxOpen(page);
await clickSelectAtIndex(page, 5);
await isListboxOpen(page);

await clickOutside(page);
await isListboxClosed(page);
});
await clickOutside(page);
await isListboxClosed(page);
});
});
Loading