Compare commits
4 Commits
transform-
...
python_run
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a43b2d35f | ||
|
|
832f8ac44d | ||
|
|
88bdc6c06c | ||
|
|
bdfc24938c |
@@ -1,173 +0,0 @@
|
||||
---
|
||||
name: clojure-eval
|
||||
description: Evaluate Clojure code via nREPL using clj-nrepl-eval. Use this when you need to test code, check if edited files compile, verify function behavior, or interact with a running REPL session.
|
||||
---
|
||||
|
||||
# Clojure REPL Evaluation
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Use this skill when you need to:
|
||||
- **Verify that edited Clojure files compile and load correctly**
|
||||
- Test function behavior interactively
|
||||
- Check the current state of the REPL
|
||||
- Debug code by evaluating expressions
|
||||
- Require or load namespaces for testing
|
||||
- Validate that code changes work before committing
|
||||
|
||||
## How It Works
|
||||
|
||||
The `clj-nrepl-eval` command evaluates Clojure code against an nREPL server. **Session state persists between evaluations**, so you can require a namespace in one evaluation and use it in subsequent calls. Each host:port combination maintains its own session file.
|
||||
|
||||
## Instructions
|
||||
|
||||
### 0. Discover and select nREPL server
|
||||
|
||||
First, discover what nREPL servers are running in the current directory:
|
||||
|
||||
```bash
|
||||
clj-nrepl-eval --discover-ports
|
||||
```
|
||||
|
||||
This will show all nREPL servers (Clojure, Babashka, shadow-cljs, etc.) running in the current project directory.
|
||||
|
||||
**Then use the AskUserQuestion tool:**
|
||||
|
||||
- **If ports are discovered:** Prompt user to select which nREPL port to use:
|
||||
- **question:** "Which nREPL port would you like to use?"
|
||||
- **header:** "nREPL Port"
|
||||
- **options:** Present each discovered port as an option with:
|
||||
- **label:** The port number
|
||||
- **description:** The server type and status (e.g., "Clojure nREPL server in current directory")
|
||||
- Include up to 4 discovered ports as options
|
||||
- The user can select "Other" to enter a custom port number
|
||||
|
||||
- **If no ports are discovered:** Prompt user how to start an nREPL server:
|
||||
- **question:** "No nREPL servers found. How would you like to start one?"
|
||||
- **header:** "Start nREPL"
|
||||
- **options:**
|
||||
- **label:** "deps.edn alias", **description:** "Find and use an nREPL alias in deps.edn"
|
||||
- **label:** "Leiningen", **description:** "Start nREPL using 'lein repl'"
|
||||
- The user can select "Other" for alternative methods or if they already have a server running on a specific port
|
||||
|
||||
IMPORTANT: IF you start a REPL do not supply a port let the nREPL start and return the port that it was started on.
|
||||
|
||||
### 1. Evaluate Clojure Code
|
||||
|
||||
> Evaluation automatically connects to the given port
|
||||
|
||||
Use the `-p` flag to specify the port and pass your Clojure code.
|
||||
|
||||
**Recommended: Pass code as a command-line argument:**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> "(+ 1 2 3)"
|
||||
```
|
||||
|
||||
**For multiple expressions (single line):**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> "(def x 10) (+ x 20)"
|
||||
```
|
||||
|
||||
**Alternative: Using heredoc (may require permission approval for multiline commands):**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> <<'EOF'
|
||||
(def x 10)
|
||||
(+ x 20)
|
||||
EOF
|
||||
```
|
||||
|
||||
**Alternative: Via stdin pipe:**
|
||||
```bash
|
||||
echo "(+ 1 2 3)" | clj-nrepl-eval -p <PORT>
|
||||
```
|
||||
|
||||
### 2. Display nREPL Sessions
|
||||
|
||||
**Discover all nREPL servers in current directory:**
|
||||
```bash
|
||||
clj-nrepl-eval --discover-ports
|
||||
```
|
||||
Shows all running nREPL servers in the current project directory, including their type (clj/bb/basilisp) and whether they match the current working directory.
|
||||
|
||||
**Check previously connected sessions:**
|
||||
```bash
|
||||
clj-nrepl-eval --connected-ports
|
||||
```
|
||||
Shows only connections you have made before (appears after first evaluation on a port).
|
||||
|
||||
### 3. Common Patterns
|
||||
|
||||
**Require a namespace (always use :reload to pick up changes):**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> "(require '[my.namespace :as ns] :reload)"
|
||||
```
|
||||
|
||||
**Test a function after requiring:**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> "(ns/my-function arg1 arg2)"
|
||||
```
|
||||
|
||||
**Check if a file compiles:**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> "(require 'my.namespace :reload)"
|
||||
```
|
||||
|
||||
**Multiple expressions:**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> "(def x 10) (* x 2) (+ x 5)"
|
||||
```
|
||||
|
||||
**Complex multiline code (using heredoc):**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> <<'EOF'
|
||||
(def x 10)
|
||||
(* x 2)
|
||||
(+ x 5)
|
||||
EOF
|
||||
```
|
||||
*Note: Heredoc syntax may require permission approval.*
|
||||
|
||||
**With custom timeout (in milliseconds):**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> --timeout 5000 "(long-running-fn)"
|
||||
```
|
||||
|
||||
**Reset the session (clears all state):**
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> --reset-session
|
||||
clj-nrepl-eval -p <PORT> --reset-session "(def x 1)"
|
||||
```
|
||||
|
||||
## Available Options
|
||||
|
||||
- `-p, --port PORT` - nREPL port (required)
|
||||
- `-H, --host HOST` - nREPL host (default: 127.0.0.1)
|
||||
- `-t, --timeout MILLISECONDS` - Timeout (default: 120000 = 2 minutes)
|
||||
- `-r, --reset-session` - Reset the persistent nREPL session
|
||||
- `-c, --connected-ports` - List previously connected nREPL sessions
|
||||
- `-d, --discover-ports` - Discover nREPL servers in current directory
|
||||
- `-h, --help` - Show help message
|
||||
|
||||
## Important Notes
|
||||
|
||||
- **Prefer command-line arguments:** Pass code as quoted strings: `clj-nrepl-eval -p <PORT> "(+ 1 2 3)"` - works with existing permissions
|
||||
- **Heredoc for complex code:** Use heredoc (`<<'EOF' ... EOF`) for truly multiline code, but note it may require permission approval
|
||||
- **Sessions persist:** State (vars, namespaces, loaded libraries) persists across invocations until the nREPL server restarts or `--reset-session` is used
|
||||
- **Automatic delimiter repair:** The tool automatically repairs missing or mismatched parentheses
|
||||
- **Always use :reload:** When requiring namespaces, use `:reload` to pick up recent changes
|
||||
- **Default timeout:** 2 minutes (120000ms) - increase for long-running operations
|
||||
- **Input precedence:** Command-line arguments take precedence over stdin
|
||||
|
||||
## Typical Workflow
|
||||
|
||||
1. Discover nREPL servers: `clj-nrepl-eval --discover-ports`
|
||||
2. Use **AskUserQuestion** tool to prompt user to select a port
|
||||
3. Require namespace:
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> "(require '[my.ns :as ns] :reload)"
|
||||
```
|
||||
4. Test function:
|
||||
```bash
|
||||
clj-nrepl-eval -p <PORT> "(ns/my-fn ...)"
|
||||
```
|
||||
5. Iterate: Make changes, re-require with `:reload`, test again
|
||||
@@ -1,7 +1,7 @@
|
||||
;; -*- comment-column: 100; -*-
|
||||
{:config-paths ["macros" "src" "config"]
|
||||
:linters
|
||||
{;;
|
||||
{ ;;
|
||||
;; enabled optional linters (these are disabled by default)
|
||||
;;
|
||||
|
||||
@@ -179,11 +179,6 @@
|
||||
metabase.notification.models/create-notification!
|
||||
metabase.pulse.send/send-pulse!
|
||||
metabase-enterprise.transforms-python.python-runner-test/execute!
|
||||
;; Workspace isolation functions are safe in parallel tests because they operate on
|
||||
;; isolated, test-specific workspaces and databases that don't affect other tests
|
||||
metabase-enterprise.workspaces.isolation/destroy-workspace-isolation!
|
||||
metabase-enterprise.workspaces.isolation/ensure-database-isolation!
|
||||
metabase-enterprise.workspaces.test-util/create-ready-ws!
|
||||
;; Safe in tests, where we typically use a private, temporary index per thread.
|
||||
metabase.search.core/reindex!
|
||||
metabase.util/run-count!
|
||||
@@ -197,7 +192,7 @@
|
||||
:metabase/disallow-hardcoded-driver-names-in-tests
|
||||
;; don't include `:h2` since that will probably lead to a mountain of tests where we are specifically testing
|
||||
;; middleware or compilation behavior with just H2 since it's the default.
|
||||
{:drivers #{;; core drivers
|
||||
{:drivers #{ ;; core drivers
|
||||
#_:h2
|
||||
:postgres
|
||||
:mysql
|
||||
@@ -429,8 +424,6 @@
|
||||
metabase-enterprise.transforms.api-test/with-worker-runs clojure.core/let
|
||||
metabase-enterprise.transforms.test-util/with-transform-cleanup! clojure.core/let
|
||||
metabase-enterprise.transforms.execute/with-transform-lifecycle clojure.core/let
|
||||
metabase-enterprise.workspaces.test-util/with-resources! clojure.core/let
|
||||
metabase-enterprise.workspaces.test-util/with-workspaces! clojure.core/let
|
||||
metabase.actions.test-util/with-actions clojure.core/let
|
||||
metabase.api.common/let-404 clojure.core/let
|
||||
metabase.app-db.custom-migrations.util/with-temp-scheduler! clojure.core/fn
|
||||
|
||||
@@ -546,11 +546,6 @@
|
||||
metabase.driver.sql-jdbc.execute
|
||||
metabase.driver.sql-jdbc.execute.diagnostic
|
||||
metabase.driver.sql-jdbc.sync
|
||||
;; TODO (lbrdnk 2025/12/17): We should revisit addition of the following line. I've added it to make
|
||||
;; tests pass as we are using it directly with ee/workspaces module. I believe later, when workspaces
|
||||
;; are in better state quality wise, it should become part of the driver api and that should be used
|
||||
;; instead of calling directly into the normalize module.
|
||||
metabase.driver.sql.normalize
|
||||
metabase.driver.sql.query-processor
|
||||
metabase.driver.sql.util
|
||||
metabase.driver.sync
|
||||
@@ -974,8 +969,7 @@
|
||||
:api #{metabase.premium-features.api
|
||||
metabase.premium-features.core
|
||||
metabase.premium-features.init}
|
||||
:uses #{analytics
|
||||
api
|
||||
:uses #{api
|
||||
app-db
|
||||
classloader
|
||||
config
|
||||
@@ -1206,8 +1200,7 @@
|
||||
:api #{metabase.request.core
|
||||
metabase.request.init
|
||||
metabase.request.schema}
|
||||
:uses #{analytics
|
||||
api
|
||||
:uses #{api
|
||||
config
|
||||
embedding
|
||||
permissions ; FIXME
|
||||
@@ -2122,7 +2115,6 @@
|
||||
warehouses-rest
|
||||
enterprise/dependencies
|
||||
enterprise/transforms
|
||||
enterprise/transforms-base
|
||||
enterprise/transforms-python}}
|
||||
|
||||
enterprise/permission-debug
|
||||
@@ -2321,7 +2313,6 @@
|
||||
{:team "Querying"
|
||||
:api #{metabase-enterprise.transforms.api
|
||||
metabase-enterprise.transforms.core
|
||||
metabase-enterprise.transforms.execute
|
||||
metabase-enterprise.transforms.init
|
||||
metabase-enterprise.transforms.instrumentation
|
||||
metabase-enterprise.transforms.interface
|
||||
@@ -2345,31 +2336,15 @@
|
||||
revisions
|
||||
search
|
||||
settings
|
||||
sync
|
||||
task
|
||||
task-history
|
||||
util
|
||||
enterprise/transforms-base}}
|
||||
|
||||
enterprise/transforms-base
|
||||
{:team "Querying"
|
||||
:api #{metabase-enterprise.transforms-base.core
|
||||
metabase-enterprise.transforms-base.interface
|
||||
metabase-enterprise.transforms-base.ordering
|
||||
metabase-enterprise.transforms-base.util}
|
||||
:uses #{driver
|
||||
events
|
||||
lib
|
||||
lib-be
|
||||
premium-features
|
||||
query-processor
|
||||
sync
|
||||
util}}
|
||||
|
||||
enterprise/transforms-python
|
||||
{:team "Querying"
|
||||
:api #{metabase-enterprise.transforms-python.api
|
||||
metabase-enterprise.transforms-python.init
|
||||
metabase-enterprise.transforms-python.python-runner}
|
||||
metabase-enterprise.transforms-python.init}
|
||||
:uses #{analytics
|
||||
api
|
||||
app-db
|
||||
@@ -2380,8 +2355,7 @@
|
||||
query-processor
|
||||
settings
|
||||
util
|
||||
enterprise/transforms
|
||||
enterprise/transforms-base}}
|
||||
enterprise/transforms}}
|
||||
|
||||
enterprise/upload-management
|
||||
{:team "UX West"
|
||||
@@ -2390,30 +2364,7 @@
|
||||
models
|
||||
premium-features
|
||||
upload
|
||||
util}}
|
||||
|
||||
enterprise/workspaces
|
||||
{:team "Metabot"
|
||||
:api #{metabase-enterprise.workspaces.api
|
||||
metabase-enterprise.workspaces.init}
|
||||
:uses #{api
|
||||
api-keys
|
||||
config
|
||||
driver
|
||||
events
|
||||
lib
|
||||
lib-be
|
||||
models
|
||||
queries
|
||||
;; NOTE: we will remove this once we get "pure transforms" module.
|
||||
query-processor
|
||||
request
|
||||
settings
|
||||
system
|
||||
util
|
||||
enterprise/transforms
|
||||
enterprise/transforms-base
|
||||
enterprise/transforms-python}}}
|
||||
util}}}
|
||||
|
||||
;; namespaces matching these patterns (with `re-find`) are excluded from the module linter. Since regex literals
|
||||
;; aren't allowed in EDN just used the `(str <regex>)` version i.e. two slashes instead of one.
|
||||
|
||||
@@ -90,7 +90,6 @@
|
||||
metabase-enterprise.test/with-gtaps! [[:inner 0]]
|
||||
metabase-enterprise.test/with-gtaps-for-user! [[:inner 0]]
|
||||
metabase-enterprise.test/with-user-attributes [[:block 2]]
|
||||
metabase-enterprise.workspaces.models.workspace-log/track! [[:block 2]]
|
||||
metabase.actions.actions-test/with-actions-test-data-and-actions-permissively-enabled [[:block 0]]
|
||||
metabase.actions.test-util/with-actions [[:block 1]]
|
||||
metabase.actions.test-util/with-actions-disabled [[:block 0]]
|
||||
@@ -134,7 +133,6 @@
|
||||
metabase.driver.sql-jdbc.execute.diagnostic/capturing-diagnostic-info [[:block 1]]
|
||||
metabase.driver.sql.query-processor/apply-top-level-clause [[:default]]
|
||||
metabase.driver/with-driver [[:block 1]]
|
||||
metabase.driver/with-swapped-connection-details [[:block 2]]
|
||||
metabase.embedding-rest.api.embed-test/do-response-formats [[:block 1]]
|
||||
metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
|
||||
metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-card-referencing [[:block 3]]
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
(eval . (put-clojure-indent 'u/prog1 1))
|
||||
(eval . (put-clojure-indent 'u/select-keys-when '(:form)))
|
||||
(eval . (put-clojure-indent 'with-meta '(:form)))
|
||||
(eval . (put-clojure-indent 'ws.log/track! 2))
|
||||
;; these ones have to be done with `define-clojure-indent' for now because of upstream bug
|
||||
;; https://github.com/clojure-emacs/clojure-mode/issues/600 once that's resolved we should use `put-clojure-indent'
|
||||
;; instead. Please don't add new entries unless they don't work with `put-clojure-indent'
|
||||
|
||||
26
.eslintrc.js
26
.eslintrc.js
@@ -8,13 +8,7 @@ const path = require("path");
|
||||
// can use this flag to enable it. This is set to true in CI
|
||||
const shouldLintCssModules =
|
||||
process.env.LINT_CSS_MODULES === "true" || process.env.CI;
|
||||
const plugins = [
|
||||
"react",
|
||||
"no-only-tests",
|
||||
"ttag",
|
||||
"i18next",
|
||||
"metabase",
|
||||
];
|
||||
const plugins = ["react", "no-only-tests", "ttag", "i18next"];
|
||||
if (shouldLintCssModules) {
|
||||
plugins.push("postcss-modules");
|
||||
}
|
||||
@@ -182,11 +176,11 @@ module.exports = {
|
||||
{
|
||||
files: ["*.js", "*.jsx", "*.ts", "*.tsx"],
|
||||
rules: {
|
||||
"metabase/jtag-missing-key": "error",
|
||||
"metabase/no-unconditional-metabase-links-render": "error",
|
||||
"metabase/no-color-literals": "error",
|
||||
"metabase/no-literal-metabase-strings": "error",
|
||||
"metabase/no-oss-reinitialize-import": "error",
|
||||
"jtag-missing-key": "error",
|
||||
"no-unconditional-metabase-links-render": "error",
|
||||
"no-color-literals": "error",
|
||||
"no-literal-metabase-strings": "error",
|
||||
"no-oss-reinitialize-import": "error",
|
||||
"depend/ban-dependencies": [
|
||||
"error",
|
||||
{
|
||||
@@ -220,9 +214,9 @@ module.exports = {
|
||||
"rspack.embedding-sdk-bundle.config.js",
|
||||
],
|
||||
rules: {
|
||||
"metabase/no-color-literals": "off",
|
||||
"metabase/no-unconditional-metabase-links-render": "off",
|
||||
"metabase/no-literal-metabase-strings": "off",
|
||||
"no-color-literals": "off",
|
||||
"no-unconditional-metabase-links-render": "off",
|
||||
"no-literal-metabase-strings": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -343,7 +337,7 @@ module.exports = {
|
||||
"import/no-default-export": "off",
|
||||
"import/order": "off",
|
||||
"import/no-unresolved": "off",
|
||||
"metabase/no-color-literals": "off",
|
||||
"no-color-literals": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# execute this in your shell to enable custom merge driver:
|
||||
# echo '\n[include]\npath=../.gitconfig' >> .git/config
|
||||
[merge "yaml-migrations"]
|
||||
name = YAML migration changeset-aware merge
|
||||
driver = bin/mage -merge-yaml-migrations %O %A %B %L %P
|
||||
#
|
||||
# TODO (Bryan 12/12/25) -- reenable this when we can completely verify correctness
|
||||
# [merge "yaml-migrations"]
|
||||
# name = YAML migration changeset-aware merge
|
||||
# driver = mage -merge-yaml-migrations %O %A %B %L %P
|
||||
|
||||
3
.github/scripts/setup-python-runner.sh
vendored
3
.github/scripts/setup-python-runner.sh
vendored
@@ -19,11 +19,12 @@ while [[ $# -gt 0 ]]; do
|
||||
done
|
||||
|
||||
echo "Cloning python-runner repository..."
|
||||
git clone --depth 1 https://${METABASE_AUTOMATION_USER_TOKEN}@github.com/metabase/python-runner-container.git python-runner
|
||||
git clone https://${METABASE_AUTOMATION_USER_TOKEN}@github.com/metabase/python-runner-container.git python-runner
|
||||
|
||||
if [ "$SKIP_START" = false ]; then
|
||||
echo "Starting python-runner..."
|
||||
cd python-runner
|
||||
git checkout origin/memory_improvements_2
|
||||
make run-ci 1> ../python-runner.out.log 2> ../python-runner.err.log
|
||||
make logs 1>> ../python-runner.out.log 2>> ../python-runner.err.log &
|
||||
cd ..
|
||||
|
||||
23
.github/workflows/drivers.yml
vendored
23
.github/workflows/drivers.yml
vendored
@@ -85,7 +85,6 @@ jobs:
|
||||
|
||||
be-tests-athena-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.athena-should-run == 'true' || needs.determine-driver-skips.outputs.athena-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -135,7 +134,6 @@ jobs:
|
||||
|
||||
be-tests-bigquery-cloud-sdk-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.bigquery-should-run == 'true' || needs.determine-driver-skips.outputs.bigquery-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
@@ -207,7 +205,6 @@ jobs:
|
||||
|
||||
be-tests-clickhouse-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.clickhouse-should-run == 'true' || needs.determine-driver-skips.outputs.clickhouse-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
@@ -289,7 +286,6 @@ jobs:
|
||||
|
||||
be-tests-druid-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.druid-should-run == 'true' || needs.determine-driver-skips.outputs.druid-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -337,7 +333,6 @@ jobs:
|
||||
|
||||
be-tests-druid-jdbc-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.druid-jdbc-should-run == 'true' || needs.determine-driver-skips.outputs.druid-jdbc-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -385,7 +380,6 @@ jobs:
|
||||
|
||||
be-tests-databricks-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.databricks-should-run == 'true' || needs.determine-driver-skips.outputs.databricks-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -433,7 +427,6 @@ jobs:
|
||||
|
||||
be-tests-databricks-multi-catalog-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.databricks-should-run == 'true' || needs.determine-driver-skips.outputs.databricks-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -482,7 +475,6 @@ jobs:
|
||||
|
||||
be-tests-h2:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.h2-should-run == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -512,7 +504,6 @@ jobs:
|
||||
|
||||
be-tests-mysql-mariadb:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.mysql-mariadb-should-run == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
@@ -648,7 +639,6 @@ jobs:
|
||||
|
||||
be-tests-mongo:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.mongo-should-run == 'true' || needs.determine-driver-skips.outputs.mongo-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
@@ -728,7 +718,6 @@ jobs:
|
||||
|
||||
be-tests-mongo-ssl:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.mongo-ssl-should-run == 'true' || needs.determine-driver-skips.outputs.mongo-ssl-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
@@ -804,7 +793,7 @@ jobs:
|
||||
|
||||
be-tests-mongo-sharded-cluster-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.mongo-sharded-cluster-should-run == 'true' || needs.determine-driver-skips.outputs.mongo-sharded-cluster-quarantine-conflict == 'true' }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -849,7 +838,6 @@ jobs:
|
||||
|
||||
be-tests-oracle:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.oracle-should-run == 'true' || needs.determine-driver-skips.outputs.oracle-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
@@ -934,7 +922,6 @@ jobs:
|
||||
|
||||
be-tests-postgres:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.postgres-should-run == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
@@ -1043,7 +1030,6 @@ jobs:
|
||||
|
||||
be-tests-presto-jdbc-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.presto-jdbc-should-run == 'true' || needs.determine-driver-skips.outputs.presto-jdbc-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -1124,7 +1110,6 @@ jobs:
|
||||
|
||||
be-tests-redshift-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.redshift-should-run == 'true' || needs.determine-driver-skips.outputs.redshift-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
@@ -1214,7 +1199,6 @@ jobs:
|
||||
|
||||
be-tests-snowflake-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.snowflake-should-run == 'true' || needs.determine-driver-skips.outputs.snowflake-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
@@ -1296,7 +1280,6 @@ jobs:
|
||||
|
||||
be-tests-sparksql-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.sparksql-should-run == 'true' || needs.determine-driver-skips.outputs.sparksql-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -1342,7 +1325,6 @@ jobs:
|
||||
|
||||
be-tests-sqlite-ee:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.sqlite-should-run == 'true' || needs.determine-driver-skips.outputs.sqlite-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -1383,7 +1365,6 @@ jobs:
|
||||
|
||||
be-tests-sqlserver:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.sqlserver-should-run == 'true' || needs.determine-driver-skips.outputs.sqlserver-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
@@ -1504,7 +1485,6 @@ jobs:
|
||||
|
||||
login-to-ecr:
|
||||
needs: determine-driver-skips
|
||||
if: ${{ needs.determine-driver-skips.outputs.vertica-should-run == 'true' || needs.determine-driver-skips.outputs.vertica-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
@@ -1534,7 +1514,6 @@ jobs:
|
||||
|
||||
be-tests-vertica-ee:
|
||||
needs: [determine-driver-skips, login-to-ecr]
|
||||
if: ${{ needs.determine-driver-skips.outputs.vertica-should-run == 'true' || needs.determine-driver-skips.outputs.vertica-quarantine-conflict == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
|
||||
16
.github/workflows/update-e2e-timings.yml
vendored
16
.github/workflows/update-e2e-timings.yml
vendored
@@ -23,16 +23,9 @@ jobs:
|
||||
env:
|
||||
DAYS_BACK: ${{ inputs.days_back || 7 }}
|
||||
steps:
|
||||
- name: Generate GitHub App Token
|
||||
uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.METABASE_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
@@ -48,7 +41,7 @@ jobs:
|
||||
const result = await collectAndAverageTimings({
|
||||
github,
|
||||
context,
|
||||
token: '${{ steps.app-token.outputs.token }}',
|
||||
token: '${{ secrets.GITHUB_TOKEN }}',
|
||||
daysBack: ${{ env.DAYS_BACK }},
|
||||
existingTimingsPath: 'e2e/support/timings.json'
|
||||
});
|
||||
@@ -66,7 +59,7 @@ jobs:
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ env.BRANCH_NAME }}
|
||||
base: master
|
||||
commit-message: |
|
||||
@@ -96,7 +89,4 @@ jobs:
|
||||
Co-Authored-By: GitHub Actions <actions@github.com>
|
||||
labels: |
|
||||
.CI & Tests
|
||||
no-backport
|
||||
add-paths: e2e/support/timings.json
|
||||
team-reviewers: |
|
||||
devexp
|
||||
|
||||
@@ -24,9 +24,6 @@
|
||||
"dev.failsafe" {"failsafe" {:resource "LICENSE"}}
|
||||
"colorize" {"colorize" {:resource "EPL.txt"}}
|
||||
"com.github.jnr" {"jffi$native" {:resource "apache2_0.txt"}}
|
||||
"com.google.api" {"gax" {:resource "BSD.txt"}
|
||||
"gax-grpc" {:resource "BSD.txt"}
|
||||
"gax-httpjson" {:resource "BSD.txt"}}
|
||||
"com.google.api-client" {"google-api-client" {:resource "apache2_0.txt"}}
|
||||
"com.google.auto.value" {"auto-value-annotations" {:resource "apache2_0.txt"}}
|
||||
"com.google.http-client" {"google-http-client" {:resource "apache2_0.txt"}
|
||||
@@ -63,7 +60,6 @@
|
||||
"net.thisptr" {"jackson-jq" {:resource "apache2_0.txt"}}
|
||||
"org.antlr" {"antlr-runtime" {:resource "BSD.txt"}
|
||||
"antlr4-runtime" {:resource "BSD.txt"}}
|
||||
"org.codehaus.mojo" {"animal-sniffer-annotations" {:resource "MIT.txt"}}
|
||||
"org.eclipse.jgit" {"org.eclipse.jgit" {:resource "BSD.txt"}}
|
||||
"org.eclipse.jetty" {"jetty-webapp" {:resource "EPL.txt"}}
|
||||
"org.eclipse.jetty.toolchain" {"jetty-jakarta-servlet-api" {:resource "EPL.txt"}}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
;; new ids should conform this format
|
||||
:id-with-timestamp ;; e.g: v49.2023-12-14T08:54:54
|
||||
(s/and #(re-matches id-timestamp-format-re %))
|
||||
:id-with-old-version-format ;; e.g: v49.00-008
|
||||
:id-with-old-verion-format ;; e.g: v49.00-008
|
||||
(s/and #(re-matches id-number-format-re %)
|
||||
;; the cut off id for this old format is v49.00-060
|
||||
;; see #36787 for context
|
||||
|
||||
@@ -144,18 +144,6 @@
|
||||
change-log
|
||||
#(pos? (compare % "v49.00-000"))))
|
||||
|
||||
(defn require-primary-key-exists-has-table-name
|
||||
"Ensures that all primaryKeyExists preconditions specify a tableName."
|
||||
[change-log]
|
||||
(doseq [{:keys [changeSet]} change-log
|
||||
:when changeSet
|
||||
:let [s (pr-str (:preConditions changeSet))]
|
||||
:when (and (str/includes? s ":primaryKeyExists")
|
||||
(not (str/includes? s ":tableName")))]
|
||||
(throw (validation-error
|
||||
(format "Migration '%s' has primaryKeyExists precondition without tableName" (:id changeSet))
|
||||
{:id (:id changeSet)}))))
|
||||
|
||||
(s/def ::changeSet
|
||||
(s/spec :change-set.strict/change-set))
|
||||
|
||||
@@ -175,7 +163,6 @@
|
||||
(require-no-bare-blob-or-text-types change-log)
|
||||
(require-no-bare-boolean-types change-log)
|
||||
(require-no-datetime-type change-log)
|
||||
(require-primary-key-exists-has-table-name change-log)
|
||||
(let [{:keys [changeSet]
|
||||
:as all} (group-by only-key change-log)]
|
||||
(when-not (set/subset? (set (keys all)) #{:property :objectQuotingStrategy :changeSet})
|
||||
|
||||
13
deps.edn
13
deps.edn
@@ -33,7 +33,7 @@
|
||||
com.clearspring.analytics/stream {:mvn/version "2.9.8" ; Various sketching algorithms
|
||||
:exclusions [it.unimi.dsi/fastutil
|
||||
org.slf4j/slf4j-api]}
|
||||
com.clojure-goes-fast/jvm-alloc-rate-meter {:mvn/version "0.1.4"} ; Monitor heap allocation rate.
|
||||
com.clojure-goes-fast/jvm-alloc-rate-meter{:mvn/version "0.1.4"} ; Monitor heap allocation rate.
|
||||
com.clojure-goes-fast/jvm-hiccup-meter {:mvn/version "0.1.1"} ; Monitor GC pauses and other system-induced pauses.
|
||||
com.draines/postal {:mvn/version "2.0.5" ; SMTP library
|
||||
:exclusions [com.sun.mail/jakarta.mail]}
|
||||
@@ -42,7 +42,7 @@
|
||||
com.github.albfernandez/juniversalchardet {:mvn/version "2.5.0"}
|
||||
com.github.blagerweij/liquibase-sessionlock {:mvn/version "1.6.9"} ; session lock for liquibase migrations
|
||||
com.github.jknack/handlebars ^:antq/exclude ; 4.4.0 requires java 17+
|
||||
{:mvn/version "4.3.1"} ; templating engine
|
||||
{:mvn/version "4.3.1"} ; templating engine
|
||||
com.github.oliyh/martian-clj-http {:mvn/version "0.2.1"} ; openapi client
|
||||
com.github.seancorfield/honeysql {:mvn/version "2.7.1350"} ; Honey SQL 2. SQL generation from Clojure data maps
|
||||
com.github.seancorfield/next.jdbc {:mvn/version "1.3.1070"} ; Talk to JDBC DBs
|
||||
@@ -50,12 +50,12 @@
|
||||
com.github.vertical-blank/sql-formatter {:mvn/version "2.0.5"} ; Java SQL formatting library https://github.com/vertical-blank/sql-formatter
|
||||
com.google.guava/guava {:mvn/version "33.5.0-jre"} ; dep for BigQuery, Spark, and GA. Require here rather than letting different dep versions stomp on each other — see comments on #9697
|
||||
com.h2database/h2 ^:antq/exclude ; https://metaboat.slack.com/archives/CKZEMT1MJ/p1727191010259979
|
||||
{:mvn/version "2.1.214"} ; embedded SQL database
|
||||
{:mvn/version "2.1.214"} ; embedded SQL database
|
||||
com.ibm.icu/icu4j {:mvn/version "78.1"} ; Used to transliterate Unicode characters into Latin characters
|
||||
com.knuddels/jtokkit {:mvn/version "1.1.0"} ; Java tokenizer library for OpenAI models, used for token counting in semantic search
|
||||
com.mchange/c3p0 {:mvn/version "0.11.2"} ; DB connection pool
|
||||
com.snowplowanalytics/snowplow-java-tracker ^:antq/exclude ; 2+ depend on apache httpclient 5.x, but saml and clj-http depend on 4.x
|
||||
{:mvn/version "1.0.1"} ; Snowplow analytics
|
||||
{:mvn/version "1.0.1"} ; Snowplow analytics
|
||||
com.sun.mail/jakarta.mail ^:antq/exclude ; 2+ changes imports from javax.mail to jakarta.mail
|
||||
{:mvn/version "1.6.8"} ; SMTP lib, required by postal
|
||||
com.taoensso/encore {:mvn/version "3.158.0"} ; Utilities library (used by Nippy)
|
||||
@@ -84,7 +84,7 @@
|
||||
io.github.eerohele/pp {#_#_:git/tag "2024-11-13.77" ; super fast pretty-printing library
|
||||
:git/sha "ffc4edc482c057cd9412c62f018a41e9140c618b"
|
||||
:git/url "https://github.com/eerohele/pp"}
|
||||
io.github.metabase/macaw {:mvn/version "0.2.34"} ; Parse native SQL queries
|
||||
io.github.metabase/macaw {:mvn/version "0.2.33"} ; Parse native SQL queries
|
||||
io.netty/netty-codec-http {:mvn/version "4.2.9.Final"} ; override of transitive dep from aws s3
|
||||
io.prometheus/simpleclient_hotspot {:mvn/version "0.16.0"} ; prometheus jvm collector
|
||||
junegunn/grouper {:mvn/version "0.1.1"} ; Batch processing helper
|
||||
@@ -891,7 +891,8 @@
|
||||
{:exec-args {:only ["enterprise/backend/test/metabase_enterprise/transforms"
|
||||
"enterprise/backend/test/metabase_enterprise/transforms_python"]}}
|
||||
|
||||
;; test all MBQL related stuff: MLv2, the legacy shared `metabase.legacy-mbql` code, and the QP
|
||||
|
||||
;; test all MBQL related stuff: MLv2, the legacy shared `metabase.legacy-mbql` code, and the QP
|
||||
;;
|
||||
;; clj -X:dev:ee:ee-dev:test:test/mbql
|
||||
:test/mbql
|
||||
|
||||
@@ -4673,10 +4673,6 @@
|
||||
},
|
||||
"required" : [ "type" ]
|
||||
},
|
||||
"metabase-enterprise.transforms.schema.id" : {
|
||||
"type" : "integer",
|
||||
"minimum" : 1
|
||||
},
|
||||
"metabase-enterprise.transforms.schema.source-incremental-strategy" : {
|
||||
"oneOf" : [ {
|
||||
"$ref" : "#/components/schemas/metabase-enterprise.transforms.schema.checkpoint-strategy"
|
||||
@@ -4781,9 +4777,6 @@
|
||||
"type" : "null"
|
||||
} ]
|
||||
},
|
||||
"id" : {
|
||||
"$ref" : "#/components/schemas/metabase-enterprise.transforms.schema.id"
|
||||
},
|
||||
"name" : {
|
||||
"type" : "string"
|
||||
},
|
||||
@@ -4794,7 +4787,7 @@
|
||||
"$ref" : "#/components/schemas/metabase-enterprise.transforms.schema.transform-target"
|
||||
}
|
||||
},
|
||||
"required" : [ "id", "name", "source", "target" ]
|
||||
"required" : [ "name", "source", "target" ]
|
||||
},
|
||||
"metabase-enterprise.transforms.schema.transform-source" : {
|
||||
"oneOf" : [ {
|
||||
@@ -28221,31 +28214,11 @@
|
||||
"/api/ee/transform/extract-columns" : {
|
||||
"post" : {
|
||||
"summary" : "POST /api/ee/transform/extract-columns",
|
||||
"description" : "Extract column names suitable for incremental transform checkpoint filtering.\n\n This endpoint is specifically for populating the checkpoint column dropdown in\n incremental transforms. It only returns columns with types supported for checkpoint\n filtering: temporal (timestamp/tz) and numeric (int/float) types.\n\n Text, boolean, and other unsupported column types are filtered out.\n\n The query is compiled to native SQL using [[qp.compile/compile-with-inline-parameters]],\n which handles parameterized queries with template tags. Then extracts column names\n and types using PreparedStatement metadata.\n\n Returns a map with a :columns key containing a vector of column names (strings).\n If extraction fails, returns nil for :columns.",
|
||||
"description" : "Extract column names from an MBQL query without executing it.\n\n Compiles the query to native SQL using [[qp.compile/compile-with-inline-parameters]],\n which handles parameterized queries with template tags. Then extracts column names\n using PreparedStatement metadata.\n\n Returns a map with a :columns key containing a vector of column names (strings).\n If extraction fails, returns nil for :columns.",
|
||||
"parameters" : [ ],
|
||||
"responses" : {
|
||||
"2XX" : {
|
||||
"description" : "Successful response",
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"schema" : {
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"columns" : {
|
||||
"oneOf" : [ {
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string"
|
||||
}
|
||||
}, {
|
||||
"type" : "null"
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"required" : [ "columns" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
"description" : "Successful response"
|
||||
},
|
||||
"4XX" : {
|
||||
"description" : "Client error response"
|
||||
|
||||
@@ -107,7 +107,7 @@ Allowed iframe hosts.
|
||||
- Default: `true`
|
||||
- [Configuration file name](./config-file.md): `anon-tracking-enabled`
|
||||
|
||||
Enable the collection of anonymous usage data in order to help us improve.
|
||||
Enable the collection of anonymous usage data in order to help Metabase improve.
|
||||
|
||||
### `MB_API_KEY`
|
||||
|
||||
|
||||
@@ -6,18 +6,7 @@ title: Driver interface changelog
|
||||
|
||||
## Metabase 0.59.0
|
||||
|
||||
- Added `sql-jdbc.execute/db-type-name` multimethod. Override this method when your sql-jdbc-based driver needs to
|
||||
customize how database type names are retrieved from result set metadata, for example when certain types need to be
|
||||
remapped based on precision or connection settings. For example, the `:mysql` implementation remaps `TINYINT` with
|
||||
precision 1 to `BIT` (boolean), ensuring type consistency between sync and query execution.
|
||||
|
||||
- Added workspace isolation multimethods for enterprise workspaces feature:
|
||||
- `init-workspace-isolation!` - Initialize database isolation for a workspace by creating an isolated schema or
|
||||
database with user credentials
|
||||
- `destroy-workspace-isolation!` - Destroy all database resources created for workspace isolation
|
||||
- `grant-workspace-read-access!` - Grant read access on specified tables to a workspace's isolated user
|
||||
- `check-isolation-permissions` - Check if the database connection has sufficient permissions for workspace isolation
|
||||
by testing the actual operations
|
||||
- Added `sql-jdbc.execute/db-type-name` multimethod. Override this if something more than the default is needed in your sql-jdbc-based driver. See the `:mysql` implementation as an example.
|
||||
|
||||
## Metabase 0.58.0
|
||||
|
||||
@@ -49,17 +38,10 @@ title: Driver interface changelog
|
||||
longer include parent column names for drivers like MongoDB -- use `qp.add.nfc-path` instead to qualify the
|
||||
`qp.add.source-column-alias` with parent column names as needed.
|
||||
|
||||
- Added the following driver methods to implement sql transforms.
|
||||
- metabase.driver/compile-drop-table
|
||||
- metabase.driver/compile-transform
|
||||
- metabase.driver/connection-spec
|
||||
- metabase.driver/drop-transform-target!
|
||||
- metabase.driver/execute-raw-queries!
|
||||
- metabase.driver/native-query-deps
|
||||
- metabase.driver/run-transform!
|
||||
- metabase.driver/table-exists?
|
||||
- metabase.driver.sql/default-schema
|
||||
- metabase.driver.sql/normalize-name
|
||||
- Added metabase.driver/compile-transform, metabase.driver/compile-drop-table, metabase.driver/execute-raw-queries!,
|
||||
metabase.driver/run-transform!, metabase.driver/drop-transform-target!, metabase.driver/native-query-deps,
|
||||
metabase.driver/connection-spec, metabase.driver/table-exists?, metabase.driver.sql/normalize-name,
|
||||
and metabase.driver.sql/default-schema to implement sql transforms.
|
||||
|
||||
- Added `metabase.driver/rename-tables!*` multimethod for atomic table renaming operations. Takes a map of {from-table to-table}
|
||||
pairs that has been topologically sorted.
|
||||
@@ -73,15 +55,7 @@ title: Driver interface changelog
|
||||
- Added `metabase.driver/type->database-type` multimethod that returns the database type for a given Metabase
|
||||
type (from the type hierarchy) as a HoneySQL spec. This method handles general Metabase base types.
|
||||
|
||||
- Added the following driver multimethods for use with the :dependencies/native feature:
|
||||
- driver/native-result-metadata
|
||||
- driver/validate-native-query-fields
|
||||
- driver.sql.normalize-unquoted-name
|
||||
- driver.sql.normalize/reserved-literal
|
||||
- driver.sql.references/field-references-impl
|
||||
- driver.sql.references/find-returned-fields
|
||||
- driver.sql.references/find-used-fields
|
||||
- driver.sql/resolve-field
|
||||
- Added driver multimethods driver/native-result-metadata, driver/validate-native-query-fields, driver.sql/resolve-field, driver.sql.normalize-unquoted-name, driver.sql.normalize/reserved-literal, driver.sql.references/find-used-fields, driver.sql.references/find-returned-fields, and driver.sql.references/field-references-impl for use with the :dependencies/native feature.
|
||||
|
||||
- Added `metabase.driver/insert-from-source!` multimethod that abstracts data insertion from various sources
|
||||
into existing tables. This multimethod dispatches on both the driver and the data source type
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
# Metabase
|
||||
|
||||
Links to `llms.txt` files for Metabase. These files contains the full documentation and guide for AI agents on these Metabase-related topics:
|
||||
|
||||
- [Embedding Metabase with Modular Embedding](./embedding/llms.txt)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"rules": {
|
||||
"metabase/no-unscoped-text-selectors": 2,
|
||||
"no-unscoped-text-selectors": 2,
|
||||
"import/no-commonjs": 0,
|
||||
"metabase/no-color-literals": 0,
|
||||
"no-color-literals": 0,
|
||||
"no-console": 0,
|
||||
"@typescript-eslint/no-namespace": "off",
|
||||
"cypress/no-assigning-return-values": "error",
|
||||
@@ -49,9 +49,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"metabase/no-direct-helper-import": 2,
|
||||
"metabase/no-unsafe-element-filtering": ["warn"],
|
||||
"metabase/no-unordered-test-helpers": 2
|
||||
"no-direct-helper-import": 2,
|
||||
"no-unsafe-element-filtering": ["warn"],
|
||||
"no-unordered-test-helpers": 2
|
||||
},
|
||||
"env": {
|
||||
"cypress/globals": true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import "cypress-iframe";
|
||||
|
||||
// this is the only place we allow direct helper import
|
||||
// eslint-disable-next-line metabase/no-direct-helper-import
|
||||
// eslint-disable-next-line no-direct-helper-import
|
||||
import { H } from "e2e/support";
|
||||
|
||||
import "./commands/ui/button";
|
||||
|
||||
@@ -42,8 +42,4 @@ export { remapDisplayValueToFK } from "./remapDisplayValueToFK";
|
||||
export { unpublishTables } from "./unpublishTables";
|
||||
export { updateComment } from "./updateComment";
|
||||
export { updateDashboardCards } from "./updateDashboardCards";
|
||||
export {
|
||||
updateSetting,
|
||||
updateEnterpriseSetting,
|
||||
updateEnterpriseSettings,
|
||||
} from "./updateSetting";
|
||||
export { updateSetting, updateEnterpriseSetting } from "./updateSetting";
|
||||
|
||||
@@ -19,12 +19,3 @@ export const updateEnterpriseSetting = <
|
||||
): Cypress.Chainable<Cypress.Response<never>> => {
|
||||
return cy.request<never>("PUT", `/api/setting/${setting}`, { value });
|
||||
};
|
||||
|
||||
export const updateEnterpriseSettings = <
|
||||
TKey extends keyof EnterpriseSettings,
|
||||
TValue extends EnterpriseSettings[TKey],
|
||||
>(
|
||||
settings: Record<TKey, TValue>,
|
||||
): Cypress.Chainable<Cypress.Response<never>> => {
|
||||
return cy.request<never>("PUT", "/api/setting", settings);
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// eslint-disable-next-line metabase/no-direct-helper-import
|
||||
// eslint-disable-next-line no-direct-helper-import
|
||||
import { H } from "e2e/support";
|
||||
|
||||
export const tryToCreateApiKeyViaModal = ({
|
||||
|
||||
@@ -11,11 +11,7 @@ export function codeMirrorHelpers<T extends object>(testId: string, extra: T) {
|
||||
return cy.get(`[data-testid=${testId}] .cm-content`);
|
||||
},
|
||||
focus() {
|
||||
helpers.get().should("be.visible").focus();
|
||||
// Move caret to end
|
||||
const isMac = Cypress.platform === "darwin";
|
||||
cy.realPress([isMac ? "Meta" : "Control", "End"]);
|
||||
|
||||
helpers.get().should("be.visible").click("right");
|
||||
helpers.get().get(".cm-editor").should("have.class", "cm-focused");
|
||||
return helpers;
|
||||
},
|
||||
@@ -176,13 +172,6 @@ export function codeMirrorHelpers<T extends object>(testId: string, extra: T) {
|
||||
cy.wait(300);
|
||||
helpers.type(`{${key}}`, { focus: false });
|
||||
},
|
||||
rejectCompletion() {
|
||||
helpers.completions().should("be.visible");
|
||||
|
||||
// Avoid flakiness with CodeMirror not processing the escape immediately
|
||||
cy.wait(300);
|
||||
cy.realPress(["Escape"]);
|
||||
},
|
||||
selectCompletion(name: string) {
|
||||
helpers.completions().should("be.visible");
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export function getPersonalCollectionName(
|
||||
}
|
||||
|
||||
export function openCollectionItemMenu(item: string, index = 0) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findByTestId("collection-table")
|
||||
.findAllByText(item)
|
||||
.eq(index)
|
||||
|
||||
@@ -36,12 +36,12 @@ export function getDashboardCards() {
|
||||
}
|
||||
|
||||
export function getDashboardCard(index = 0) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return getDashboardCards().eq(index);
|
||||
}
|
||||
|
||||
export function ensureDashboardCardHasText(text: string, index = 0) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("dashcard").eq(index).should("contain", text);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,30 +16,9 @@ export const DataStudio = {
|
||||
header: () => cy.findByTestId("transforms-header"),
|
||||
list: () => cy.findByTestId("transforms-list"),
|
||||
saveChangesButton: () => DataStudio.Transforms.queryEditor().button("Save"),
|
||||
editTransform: () => cy.findByRole("button", { name: "Edit" }),
|
||||
editDefinitionButton: () =>
|
||||
cy.get(
|
||||
'[data-testid="edit-definition-button"], [data-testid="transform-edit-menu-button"]',
|
||||
),
|
||||
editDefinition: () => {
|
||||
// When workspaces are available, "Edit definition" is inside the "Edit" menu
|
||||
// When workspaces are not available, "Edit definition" is a direct link
|
||||
DataStudio.Transforms.editDefinitionButton()
|
||||
.first()
|
||||
.then(($el) => {
|
||||
if ($el.attr("data-testid") === "edit-definition-button") {
|
||||
cy.wrap($el).click();
|
||||
} else {
|
||||
cy.wrap($el).click();
|
||||
popover()
|
||||
.findByRole("menuitem", { name: /Edit definition/ })
|
||||
.click();
|
||||
}
|
||||
});
|
||||
},
|
||||
editDefinition: () => cy.findByRole("link", { name: "Edit definition" }),
|
||||
queryEditor: () => cy.findByTestId("transform-query-editor"),
|
||||
runTab: () => DataStudio.Transforms.header().findByText("Run"),
|
||||
targetTab: () => DataStudio.Transforms.header().findByText("Target"),
|
||||
settingsTab: () => DataStudio.Transforms.header().findByText("Settings"),
|
||||
dependenciesTab: () =>
|
||||
DataStudio.Transforms.header().findByText("Dependencies"),
|
||||
|
||||
@@ -9,7 +9,7 @@ export function getDimensions(isSelected) {
|
||||
}
|
||||
|
||||
export function getDimensionByName({ name, index = 0, isSelected }) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return getDimensions(isSelected).filter(`:contains("${name}")`).eq(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export function saveInteractiveQuestionAsNewQuestion(options: {
|
||||
|
||||
cy.intercept("POST", "/api/card").as("createCard");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("cell-data").last().click();
|
||||
popover().findByText(`See these ${entityName}`).click();
|
||||
cy.findByRole("button", { name: "Save" }).click();
|
||||
|
||||
@@ -73,7 +73,7 @@ export function chatMessages() {
|
||||
}
|
||||
|
||||
export function lastChatMessage() {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return chatMessages().last();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ export function addSummaryField({
|
||||
stage?: number;
|
||||
index?: number;
|
||||
}) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getNotebookStep("summarize", { stage, index })
|
||||
.findByTestId("aggregate-step")
|
||||
.findAllByTestId("notebook-cell-item")
|
||||
@@ -118,7 +118,7 @@ export function addSummaryGroupingField({
|
||||
index?: number;
|
||||
bucketSize?: string;
|
||||
}) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getNotebookStep("summarize", { stage, index })
|
||||
.findByTestId("breakout-step")
|
||||
.findAllByTestId("notebook-cell-item")
|
||||
@@ -142,7 +142,7 @@ export function addSummaryGroupingField({
|
||||
});
|
||||
|
||||
if (bucketSize) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
popover().last().findByText(bucketSize).click();
|
||||
}
|
||||
}
|
||||
@@ -339,7 +339,7 @@ function verifyNotebookExpressions(
|
||||
);
|
||||
|
||||
for (let index = 0; index < expressions.length; ++index) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getExpressionItems(stageIndex)
|
||||
.eq(index)
|
||||
.should("have.text", expressions[index]);
|
||||
@@ -360,7 +360,7 @@ function verifyNotebookFilters(
|
||||
);
|
||||
|
||||
for (let index = 0; index < filters.length; ++index) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getFilterItems(stageIndex).eq(index).should("have.text", filters[index]);
|
||||
}
|
||||
} else {
|
||||
@@ -381,7 +381,7 @@ function verifyNotebookAggregations(
|
||||
);
|
||||
|
||||
for (let index = 0; index < aggregations.length; ++index) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getSummarizeItems(stageIndex, "aggregate")
|
||||
.eq(index)
|
||||
.should("have.text", aggregations[index]);
|
||||
@@ -410,7 +410,7 @@ function verifyNotebookBreakouts(
|
||||
);
|
||||
|
||||
for (let index = 0; index < breakouts.length; ++index) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getSummarizeItems(stageIndex, "breakout")
|
||||
.eq(index)
|
||||
.should("have.text", breakouts[index]);
|
||||
@@ -444,9 +444,9 @@ function verifyNotebookSort(
|
||||
|
||||
for (let index = 0; index < sort.length; ++index) {
|
||||
const { column, order } = sort[index];
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getSortItems(stageIndex).eq(index).should("have.text", column);
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getSortItems(stageIndex)
|
||||
.eq(index)
|
||||
.icon(order === "asc" ? "arrow_up" : "arrow_down")
|
||||
|
||||
@@ -38,7 +38,7 @@ export function modifyPermission(
|
||||
}
|
||||
|
||||
export function selectPermissionRow(item, permissionIndex) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getPermissionRowPermissions(item).eq(permissionIndex).click();
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ export function assertPermissionForItem(
|
||||
permissionColumnIndex,
|
||||
permissionValue,
|
||||
) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getPermissionRowPermissions(item)
|
||||
.eq(permissionColumnIndex)
|
||||
.should("have.text", permissionValue);
|
||||
@@ -92,7 +92,7 @@ export function assertPermissionForItem(
|
||||
* @param {boolean} isDisabled
|
||||
*/
|
||||
export function isPermissionDisabled(row, index, permission, isDisabled) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return getPermissionRowPermissions(row)
|
||||
.eq(index)
|
||||
.should("have.attr", "aria-disabled", isDisabled.toString())
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
import { updateEnterpriseSettings } from "./api/updateSetting";
|
||||
import { codeMirrorHelpers } from "./e2e-codemirror-helpers";
|
||||
|
||||
export const PythonEditor = codeMirrorHelpers("python-editor", {});
|
||||
|
||||
export function setPythonRunnerSettings() {
|
||||
updateEnterpriseSettings({
|
||||
"python-runner-url": "http://localhost:5001",
|
||||
"python-runner-api-token": "dev-token-12345",
|
||||
"python-storage-s-3-endpoint": "http://localhost:4566",
|
||||
"python-storage-s-3-region": "us-east-1",
|
||||
"python-storage-s-3-bucket": "metabase-python-runner",
|
||||
"python-storage-s-3-prefix": "test-prefix",
|
||||
"python-storage-s-3-access-key": "test",
|
||||
"python-storage-s-3-secret-key": "test",
|
||||
"python-storage-s-3-container-endpoint": "http://localstack:4566",
|
||||
"python-storage-s-3-path-style-access": true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -287,15 +287,11 @@ export function createTestRoles({ type, isWritable }) {
|
||||
* @param {Object} obj
|
||||
* @param {number} [obj.databaseId] - Defaults to WRITABLE_DB_ID
|
||||
* @param {string} obj.name - The table's real name, not its display name
|
||||
* @param {string} [obj.schema] - The table's schema name
|
||||
*/
|
||||
export function getTableId({ databaseId = WRITABLE_DB_ID, name, schema }) {
|
||||
export function getTableId({ databaseId = WRITABLE_DB_ID, name }) {
|
||||
return cy.request("GET", "/api/table").then(({ body: tables }) => {
|
||||
const table = tables.find(
|
||||
(table) =>
|
||||
table.db_id === databaseId &&
|
||||
table.name === name &&
|
||||
(schema ? table.schema === schema : true),
|
||||
(table) => table.db_id === databaseId && table.name === name,
|
||||
);
|
||||
if (!table) {
|
||||
throw new TypeError(`Table with name ${name} cannot be found`);
|
||||
|
||||
@@ -78,11 +78,7 @@ export function entityPickerModalItem(level, name) {
|
||||
}
|
||||
|
||||
export function entityPickerModalTab(name) {
|
||||
if (typeof name === "string") {
|
||||
return cy.findAllByRole("tab").filter(`:contains(${name})`);
|
||||
} else {
|
||||
return cy.findAllByRole("tab").first().parent().findByText(name);
|
||||
}
|
||||
return cy.findAllByRole("tab").filter(`:contains(${name})`);
|
||||
}
|
||||
|
||||
// displays at least these tabs:
|
||||
@@ -199,12 +195,12 @@ export function filterWidget({ isEditing = false, name = null } = {}) {
|
||||
}
|
||||
|
||||
export function clearFilterWidget(index = 0) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return filterWidget().eq(index).icon("close").click();
|
||||
}
|
||||
|
||||
export function resetFilterWidgetToDefault(index = 0) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return filterWidget().eq(index).icon("revert").click();
|
||||
}
|
||||
|
||||
@@ -443,7 +439,7 @@ export function tableInteractiveFooter() {
|
||||
}
|
||||
|
||||
export function resizeTableColumn(columnId, moveX, elementIndex = 0) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId(`resize-handle-${columnId}`)
|
||||
.eq(elementIndex)
|
||||
.trigger("mousedown", {
|
||||
@@ -487,7 +483,7 @@ export function assertTableRowsCount(value) {
|
||||
}
|
||||
|
||||
export function lastTableRow() {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return tableInteractiveScrollContainer()
|
||||
.scrollTo("bottomLeft")
|
||||
.findAllByRole("row")
|
||||
@@ -551,7 +547,7 @@ export function assertTableData({ columns, firstRows = [] }) {
|
||||
.should("have.length", columns.length);
|
||||
|
||||
columns.forEach((column, index) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
tableInteractive()
|
||||
.findAllByTestId("header-cell")
|
||||
.eq(index)
|
||||
@@ -560,7 +556,7 @@ export function assertTableData({ columns, firstRows = [] }) {
|
||||
|
||||
firstRows.forEach((row, rowIndex) => {
|
||||
row.forEach((cell, cellIndex) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
tableInteractiveBody()
|
||||
.findAllByTestId("cell-data")
|
||||
.eq(columns.length * rowIndex + cellIndex)
|
||||
@@ -600,12 +596,12 @@ export function fieldValuesTextbox() {
|
||||
}
|
||||
|
||||
export function fieldValuesValue(index) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return cy.findAllByTestId("token-field").eq(index);
|
||||
}
|
||||
|
||||
export function removeFieldValuesValue(index) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return cy
|
||||
.findAllByTestId("token-field")
|
||||
.findAllByLabelText("Remove")
|
||||
@@ -614,7 +610,7 @@ export function removeFieldValuesValue(index) {
|
||||
}
|
||||
|
||||
export function multiAutocompleteValue(index, filter = ":eq(0)") {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return cy
|
||||
.findAllByRole("combobox")
|
||||
.filter(filter)
|
||||
|
||||
@@ -78,7 +78,7 @@ export function uploadFile(
|
||||
|
||||
cy.wait(`@${uploadMode}CSV`);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByRole("status")
|
||||
.last()
|
||||
.findByText(`Data added to ${collectionName}`, {
|
||||
|
||||
@@ -195,7 +195,7 @@ export function assertTooltipRow(
|
||||
name,
|
||||
{ color, value, secondaryValue, index } = {},
|
||||
) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByText(name)
|
||||
.eq(index ?? 0)
|
||||
.parent("tr")
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
import type { WorkspaceId } from "metabase-types/api";
|
||||
|
||||
export const Workspaces = {
|
||||
visit: (id: WorkspaceId) => {
|
||||
return cy.visit(`/data-studio/workspace/${id}`);
|
||||
},
|
||||
|
||||
visitDataStudio() {
|
||||
return cy.visit("/data-studio");
|
||||
},
|
||||
|
||||
visitWorkspaces() {
|
||||
return cy.visit("/data-studio/workspaces");
|
||||
},
|
||||
|
||||
visitTransformListPage() {
|
||||
return cy.visit("/data-studio/transforms");
|
||||
},
|
||||
|
||||
getWorkspacesPage() {
|
||||
return cy.findByTestId("workspaces-page");
|
||||
},
|
||||
|
||||
getWorkspacePage() {
|
||||
return cy.findByTestId("workspace-page");
|
||||
},
|
||||
|
||||
getWorkspaceContent() {
|
||||
return cy.findByTestId("workspace-content");
|
||||
},
|
||||
|
||||
getWorkspaceTabs() {
|
||||
return cy.findByTestId("workspace-tabs");
|
||||
},
|
||||
|
||||
getWorkspaceSidebar() {
|
||||
return cy.findByTestId("workspace-sidebar");
|
||||
},
|
||||
|
||||
openSetupTab() {
|
||||
this.getWorkspaceContent().findByRole("tab", { name: "Setup" }).click();
|
||||
},
|
||||
|
||||
openCodeTab() {
|
||||
this.getWorkspaceSidebar().findByRole("tab", { name: "Code" }).click();
|
||||
},
|
||||
|
||||
openDataTab() {
|
||||
this.getWorkspaceSidebar().findByRole("tab", { name: "Data" }).click();
|
||||
},
|
||||
|
||||
openGraphTab() {
|
||||
this.getWorkspaceContent().findByRole("tab", { name: "Graph" }).click();
|
||||
},
|
||||
|
||||
getWorkspacesSection() {
|
||||
return cy.findByTestId("workspaces-section");
|
||||
},
|
||||
|
||||
getWorkspaceItem(name: string) {
|
||||
return this.getWorkspacesSection().find(`a[name="${name}"]`);
|
||||
},
|
||||
|
||||
getWorkspaceItemStatus(name: string) {
|
||||
return this.getWorkspaceItem(name).findByTestId("workspace-status");
|
||||
},
|
||||
|
||||
getWorkspaceItemActions(name: string) {
|
||||
return this.getWorkspaceItem(name).findByLabelText("More actions");
|
||||
},
|
||||
|
||||
getWorkspaceNameInput() {
|
||||
return cy.findByPlaceholderText("Workspace name");
|
||||
},
|
||||
|
||||
getRunAllTransformsButton() {
|
||||
return cy.findByTestId("run-all-button");
|
||||
},
|
||||
|
||||
getMergeWorkspaceButton() {
|
||||
return cy.findByRole("button", { name: /Merge/ });
|
||||
},
|
||||
|
||||
getMergeCommitInput() {
|
||||
return cy.findByPlaceholderText(
|
||||
"Describe the changes you made in this workspace...",
|
||||
);
|
||||
},
|
||||
|
||||
getWorkspaceDatabaseSelect() {
|
||||
return cy.findByPlaceholderText("Select a database");
|
||||
},
|
||||
|
||||
getTransformTabHeader() {
|
||||
return cy.findByTestId("transform-tab-header");
|
||||
},
|
||||
|
||||
getTransformTargetButton() {
|
||||
return this.getTransformTabHeader().findByRole("button", {
|
||||
name: /Change target/,
|
||||
});
|
||||
},
|
||||
|
||||
getRunTransformButton() {
|
||||
return this.getTransformTabHeader().findByTestId("run-button", {
|
||||
timeout: 10_000,
|
||||
});
|
||||
},
|
||||
|
||||
getRunStatus() {
|
||||
return cy.findByTestId("run-status");
|
||||
},
|
||||
|
||||
getSaveTransformButton() {
|
||||
return this.getTransformTabHeader().findByRole("button", { name: /Save/ });
|
||||
},
|
||||
|
||||
getWorkspaceTransforms() {
|
||||
return cy.findByTestId("workspace-transforms");
|
||||
},
|
||||
|
||||
getMainlandTransforms() {
|
||||
return cy.findByTestId("mainland-transforms", { timeout: 10_000 });
|
||||
},
|
||||
|
||||
getNewWorkspaceButton() {
|
||||
return cy.findByRole("button", { name: /New workspace/ });
|
||||
},
|
||||
|
||||
getNewWorkspaceNameInput() {
|
||||
return cy.findByPlaceholderText("Enter workspace name");
|
||||
},
|
||||
|
||||
getNewWorkspaceDatabaseInput() {
|
||||
return cy.findByPlaceholderText("Select a database");
|
||||
},
|
||||
|
||||
getTransformStatusDot(name: string | RegExp) {
|
||||
return cy.findByText(name).parent().findByTestId("status-dot");
|
||||
},
|
||||
|
||||
getTransformTargetDiff() {
|
||||
return cy.findByTestId("transform-target-diff");
|
||||
},
|
||||
|
||||
getSourceTablesDiff() {
|
||||
return cy.findByTestId("source-tables-diff");
|
||||
},
|
||||
};
|
||||
@@ -14,9 +14,9 @@ export * from "./e2e-comment-helpers";
|
||||
export * from "./e2e-custom-column-helpers";
|
||||
export * from "./e2e-dashboard-helpers";
|
||||
export * from "./e2e-dashboard-visualizer-helpers";
|
||||
export * from "./e2e-data-studio-helpers";
|
||||
export * from "./e2e-database-metadata-helpers";
|
||||
export * from "./e2e-datamodel-helpers";
|
||||
export * from "./e2e-data-studio-helpers";
|
||||
export * from "./e2e-dependency-helpers";
|
||||
export * from "./e2e-detail-view-helpers";
|
||||
export * from "./e2e-dimension-list-helpers";
|
||||
@@ -61,5 +61,4 @@ export * from "./e2e-upload-helpers";
|
||||
export * from "./e2e-users-helpers";
|
||||
export * from "./e2e-visual-tests-helpers";
|
||||
export * from "./e2e-viz-settings-helpers";
|
||||
export * from "./e2e-workspaces-helpers";
|
||||
export * from "./embedding-sdk-helpers/constants";
|
||||
|
||||
@@ -288,12 +288,6 @@ export const many_schemas = async (dbClient) => {
|
||||
return schemas;
|
||||
};
|
||||
|
||||
export const empty_schema = async (dbClient) => {
|
||||
const schemaName = "empty_schema";
|
||||
await dbClient.schema.createSchemaIfNotExists(schemaName);
|
||||
return null;
|
||||
};
|
||||
|
||||
export const cached_table = async (dbClient) => {
|
||||
const tableName = "cached_table";
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
CollectionBrowser,
|
||||
InteractiveQuestion,
|
||||
} from "@metabase/embedding-sdk-react";
|
||||
import { InteractiveQuestion } from "@metabase/embedding-sdk-react";
|
||||
|
||||
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
|
||||
import { createQuestion, popover } from "e2e/support/helpers";
|
||||
@@ -292,82 +289,4 @@ describe("scenarios > embedding-sdk > content-translations", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("collection browser", () => {
|
||||
it("should translate collection names, item names, and descriptions", () => {
|
||||
signInAsAdminAndEnableEmbeddingSdk();
|
||||
|
||||
cy.request("POST", "/api/collection", {
|
||||
name: "Test Collection",
|
||||
parent_id: null,
|
||||
}).then(({ body: collection }) => {
|
||||
cy.wrap(collection.id).as("collectionId");
|
||||
|
||||
cy.request("POST", "/api/dashboard", {
|
||||
name: "Test Dashboard",
|
||||
description: "Dashboard description text",
|
||||
collection_id: collection.id,
|
||||
});
|
||||
|
||||
createQuestion({
|
||||
name: "Test Question",
|
||||
description: "Question description text",
|
||||
collection_id: collection.id,
|
||||
query: {
|
||||
"source-table": ORDERS_ID,
|
||||
limit: 1,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
uploadTranslationDictionaryViaAPI([
|
||||
{ locale: "de", msgid: "Test Collection", msgstr: "Test Sammlung" },
|
||||
{
|
||||
locale: "de",
|
||||
msgid: "Test Dashboard",
|
||||
msgstr: "Test Armaturenbrett",
|
||||
},
|
||||
{
|
||||
locale: "de",
|
||||
msgid: "Dashboard description text",
|
||||
msgstr: "Armaturenbrett Beschreibungstext",
|
||||
},
|
||||
{ locale: "de", msgid: "Test Question", msgstr: "Testfrage" },
|
||||
{
|
||||
locale: "de",
|
||||
msgid: "Question description text",
|
||||
msgstr: "Frage Beschreibungstext",
|
||||
},
|
||||
]);
|
||||
|
||||
cy.signOut();
|
||||
mockAuthProviderAndJwtSignIn();
|
||||
|
||||
cy.get("@collectionId").then((collectionId) => {
|
||||
mountSdkContent(
|
||||
<Flex p="xl">
|
||||
<CollectionBrowser
|
||||
collectionId={collectionId as unknown as number}
|
||||
visibleColumns={["type", "name", "description"]}
|
||||
/>
|
||||
</Flex>,
|
||||
{
|
||||
sdkProviderProps: {
|
||||
locale: "de",
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
getSdkRoot().within(() => {
|
||||
cy.findByText("Test Sammlung").should("be.visible");
|
||||
cy.findByText("Test Armaturenbrett").should("be.visible");
|
||||
cy.findByText("Testfrage").should("be.visible");
|
||||
cy.findByText("Armaturenbrett Beschreibungstext").should(
|
||||
"be.visible",
|
||||
);
|
||||
cy.findByText("Frage Beschreibungstext").should("be.visible");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -69,7 +69,7 @@ describe("scenarios > embedding-sdk > interactive-question > native", () => {
|
||||
);
|
||||
|
||||
// The first row should have the same ID column value as the initial SQL parameters
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
rows
|
||||
.findAllByTestId("cell-data")
|
||||
.eq(idColumnIndex)
|
||||
|
||||
@@ -99,7 +99,7 @@ describe("scenarios > embedding-sdk > interactive-question", () => {
|
||||
expect(response?.statusCode).to.equal(202);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("cell-data").last().click();
|
||||
|
||||
cy.on("uncaught:exception", (error) => {
|
||||
|
||||
@@ -307,7 +307,7 @@ function assertUpdatedScoreNotInTable() {
|
||||
|
||||
function assertSuccessfullUpdateToast() {
|
||||
cy.log("it shows a toast informing the update was successful");
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.undoToastList()
|
||||
.last()
|
||||
.should("be.visible")
|
||||
@@ -317,7 +317,7 @@ function assertSuccessfullUpdateToast() {
|
||||
|
||||
function assertSuccessfullDeleteToast() {
|
||||
cy.log("it shows a toast informing the delete was successful");
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.undoToastList()
|
||||
.last()
|
||||
.should("be.visible")
|
||||
|
||||
@@ -528,7 +528,7 @@ const actionButtonContainer = () =>
|
||||
cy.findByTestId("action-button-full-container");
|
||||
|
||||
const dashCard = () =>
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy
|
||||
.findAllByTestId("dashcard-container")
|
||||
.last()
|
||||
|
||||
@@ -41,7 +41,7 @@ describe("scenarios > admin > people", () => {
|
||||
cy.visit("/admin/people");
|
||||
|
||||
assertTableRowsCount(TOTAL_USERS);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${TOTAL_USERS} people found`);
|
||||
|
||||
// A small sidebar selector
|
||||
@@ -57,13 +57,13 @@ describe("scenarios > admin > people", () => {
|
||||
cy.log(
|
||||
"Dig into one of the user groups and make sure its members are listed",
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("All Users").click();
|
||||
cy.findByTestId("admin-pane-page-title").contains("All Users");
|
||||
|
||||
// The same list as for "People"
|
||||
assertTableRowsCount(TOTAL_USERS);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${TOTAL_USERS} members`);
|
||||
|
||||
// We cannot add new users to the "All users" group directly
|
||||
@@ -73,31 +73,31 @@ describe("scenarios > admin > people", () => {
|
||||
const GROUP = "collection";
|
||||
|
||||
cy.findByTestId("admin-layout-sidebar").findByText("Groups").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(GROUP).closest("tr").contains("4");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(GROUP).click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("4 members");
|
||||
|
||||
cy.button("Add members").click();
|
||||
cy.focused().type(admin.first_name);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(adminUserName).click();
|
||||
cy.button("Add").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("5 members");
|
||||
|
||||
removeUserFromGroup(adminUserName);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("4 members");
|
||||
|
||||
// should load the members when navigating to the group directly
|
||||
cy.visit(`/admin/people/groups/${DATA_GROUP}`);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("2 members");
|
||||
|
||||
cy.findByTestId("admin-layout-sidebar").findByText("People").click();
|
||||
@@ -112,13 +112,13 @@ describe("scenarios > admin > people", () => {
|
||||
|
||||
cy.findByRole("table").findByRole("link", { name: /data$/i }).click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("1 member");
|
||||
|
||||
removeUserFromGroup(normalUserName);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("0 members");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("A group is only as good as its members.");
|
||||
});
|
||||
|
||||
@@ -136,14 +136,14 @@ describe("scenarios > admin > people", () => {
|
||||
clickButton("Create");
|
||||
|
||||
// second modal
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${FULL_NAME} has been added`);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Show").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Done").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(FULL_NAME);
|
||||
cy.location().should((loc) =>
|
||||
expect(loc.pathname).to.eq("/admin/people"),
|
||||
@@ -159,14 +159,14 @@ describe("scenarios > admin > people", () => {
|
||||
clickButton("Create");
|
||||
|
||||
// second modal
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${email} has been added`);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Show").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Done").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(email);
|
||||
});
|
||||
|
||||
@@ -179,7 +179,7 @@ describe("scenarios > admin > people", () => {
|
||||
cy.findByLabelText("Last name").type(last_name + "New");
|
||||
cy.findByLabelText(/Email/).type(email.toUpperCase());
|
||||
clickButton("Create");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Email address already in use.");
|
||||
});
|
||||
|
||||
@@ -269,7 +269,7 @@ describe("scenarios > admin > people", () => {
|
||||
|
||||
cy.visit("/admin/people");
|
||||
showUserOptions(normalUserName);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Edit user").click();
|
||||
|
||||
H.modal().within(() => {
|
||||
@@ -282,7 +282,7 @@ describe("scenarios > admin > people", () => {
|
||||
clickButton("Update", { timeout: 4000 });
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(NEW_FULL_NAME);
|
||||
cy.location().should((loc) =>
|
||||
expect(loc.pathname).to.eq("/admin/people"),
|
||||
@@ -292,14 +292,14 @@ describe("scenarios > admin > people", () => {
|
||||
it("should reset user password without SMTP set up", () => {
|
||||
cy.visit("/admin/people");
|
||||
showUserOptions(normalUserName);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Reset password").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`Reset ${normalUserName}'s password?`);
|
||||
clickButton("Reset password");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${normalUserName}'s password has been reset`);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/^temporary password$/i);
|
||||
clickButton("Done");
|
||||
cy.location().should((loc) =>
|
||||
@@ -331,9 +331,9 @@ describe("scenarios > admin > people", () => {
|
||||
|
||||
cy.visit("/admin/people");
|
||||
showUserOptions(normalUserName);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Reset password").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`Reset ${normalUserName}'s password?`);
|
||||
clickButton("Reset password");
|
||||
|
||||
@@ -344,11 +344,11 @@ describe("scenarios > admin > people", () => {
|
||||
});
|
||||
|
||||
cy.log("Should not show temporary password modal");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${normalUserName}'s password has been reset`).should(
|
||||
"not.exist",
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/^temporary password$/i).should("not.exist");
|
||||
|
||||
cy.log("Should close the modal");
|
||||
@@ -461,7 +461,7 @@ describe("scenarios > admin > people", () => {
|
||||
|
||||
cy.visit("/admin/people/groups");
|
||||
cy.findByTestId("admin-layout-content").scrollTo("bottom");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("readonly");
|
||||
});
|
||||
|
||||
@@ -486,16 +486,16 @@ describe("scenarios > admin > people", () => {
|
||||
clickButton("Create");
|
||||
|
||||
// second modal
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${FULL_NAME} has been added`);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains(
|
||||
`We’ve sent an invite to ${email} with instructions to set their password.`,
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Done").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(FULL_NAME);
|
||||
});
|
||||
});
|
||||
@@ -517,11 +517,11 @@ describe("scenarios > admin > people", () => {
|
||||
cy.visit("/admin/people");
|
||||
|
||||
// Total
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${NEW_TOTAL_USERS} people found`);
|
||||
|
||||
// Page 1
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`1 - ${PAGE_SIZE}`);
|
||||
assertTableRowsCount(PAGE_SIZE);
|
||||
cy.findByLabelText("Previous page").should("be.disabled");
|
||||
@@ -539,7 +539,7 @@ describe("scenarios > admin > people", () => {
|
||||
cy.findByLabelText("Previous page").click();
|
||||
|
||||
// Page 1
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`1 - ${PAGE_SIZE}`);
|
||||
assertTableRowsCount(PAGE_SIZE);
|
||||
});
|
||||
@@ -549,17 +549,17 @@ describe("scenarios > admin > people", () => {
|
||||
cy.visit(`admin/people/groups/${ALL_USERS_GROUP}`);
|
||||
|
||||
// Total
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${NEW_TOTAL_USERS} members`);
|
||||
|
||||
// Page 1
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`1 - ${PAGE_SIZE}`);
|
||||
assertTableRowsCount(PAGE_SIZE);
|
||||
cy.findByLabelText("Previous page").should("be.disabled");
|
||||
|
||||
cy.findByLabelText("Next page").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Loading...").should("not.exist");
|
||||
|
||||
// Page 2
|
||||
@@ -568,11 +568,11 @@ describe("scenarios > admin > people", () => {
|
||||
cy.findByLabelText("Next page").should("be.disabled");
|
||||
|
||||
cy.findByLabelText("Previous page").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Loading...").should("not.exist");
|
||||
|
||||
// Page 1
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`1 - ${PAGE_SIZE}`);
|
||||
assertTableRowsCount(PAGE_SIZE);
|
||||
});
|
||||
@@ -598,9 +598,9 @@ describe("scenarios > admin > people", () => {
|
||||
});
|
||||
|
||||
cy.visit("/account/notifications");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Question");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Dashboard");
|
||||
|
||||
cy.visit("/admin/people");
|
||||
@@ -618,9 +618,9 @@ describe("scenarios > admin > people", () => {
|
||||
|
||||
cy.visit("/account/notifications");
|
||||
cy.findByLabelText("bell icon");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Question").should("not.exist");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Dashboard").should("not.exist");
|
||||
});
|
||||
|
||||
@@ -684,7 +684,7 @@ describe("scenarios > admin > people > group managers", () => {
|
||||
H.activateToken("pro-self-hosted");
|
||||
|
||||
cy.visit("/admin/people");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(normalUserName)
|
||||
.closest("tr")
|
||||
.findByText("2 other groups")
|
||||
@@ -695,7 +695,7 @@ describe("scenarios > admin > people > group managers", () => {
|
||||
cy.signInAsNormalUser();
|
||||
cy.visit("/");
|
||||
cy.icon("gear").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Admin settings").click();
|
||||
});
|
||||
|
||||
@@ -707,25 +707,25 @@ describe("scenarios > admin > people > group managers", () => {
|
||||
|
||||
// Edit group name
|
||||
cy.icon("ellipsis").eq(0).click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Edit Name").click();
|
||||
cy.findByDisplayValue("collection").type(" updated");
|
||||
cy.button("Done").click();
|
||||
|
||||
// Click on the group with the new name
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("collection updated").click();
|
||||
|
||||
// Add "No Collection" user as a member
|
||||
cy.button("Add members").click();
|
||||
cy.focused().type("No");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(noCollectionUserName).click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Add").click();
|
||||
|
||||
// Find user row
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(noCollectionUserName).closest("tr").as("userRow");
|
||||
|
||||
// Promote to manager and demote back to member
|
||||
@@ -743,11 +743,11 @@ describe("scenarios > admin > people > group managers", () => {
|
||||
cy.get("@userRow").within(() => {
|
||||
cy.icon("close").click();
|
||||
});
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(noCollectionUserName).should("not.exist");
|
||||
|
||||
// Demote myself
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(normalUserName)
|
||||
.closest("tr")
|
||||
.within(() => {
|
||||
@@ -760,11 +760,11 @@ describe("scenarios > admin > people > group managers", () => {
|
||||
cy.url().should("match", /\/admin\/people\/groups$/);
|
||||
|
||||
// Open another group
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("data").click();
|
||||
|
||||
// Remove myself
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(normalUserName)
|
||||
.closest("tr")
|
||||
.within(() => {
|
||||
@@ -778,7 +778,7 @@ describe("scenarios > admin > people > group managers", () => {
|
||||
|
||||
it("can manage members from the people page", () => {
|
||||
// Open membership select for a user
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(noCollectionUserName)
|
||||
.closest("tr")
|
||||
.as("userRow")
|
||||
@@ -809,7 +809,7 @@ describe("scenarios > admin > people > group managers", () => {
|
||||
});
|
||||
|
||||
// Find own row
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(normalUserName)
|
||||
.closest("tr")
|
||||
.within(() => {
|
||||
@@ -864,7 +864,7 @@ describe("issue 23689", () => {
|
||||
|
||||
visitGroupPermissionsPage(COLLECTION_GROUP);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("3 members");
|
||||
|
||||
findUserByFullName(normal);
|
||||
@@ -877,7 +877,7 @@ describe("issue 23689", () => {
|
||||
.click({ force: true });
|
||||
|
||||
// Sanity check instead of waiting for the PUT request
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Manager");
|
||||
|
||||
cy.sandboxTable({
|
||||
@@ -894,7 +894,7 @@ describe("issue 23689", () => {
|
||||
it("sandboxed group manager should see all other members (metabase#23689)", () => {
|
||||
visitGroupPermissionsPage(COLLECTION_GROUP);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("3 members");
|
||||
|
||||
findUserByFullName(sandboxed);
|
||||
@@ -904,7 +904,7 @@ describe("issue 23689", () => {
|
||||
cy.visit("/admin/people");
|
||||
cy.wait("@membership");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${totalUsers} people found`);
|
||||
findUserByFullName(sandboxed);
|
||||
findUserByFullName(normal);
|
||||
|
||||
@@ -76,7 +76,7 @@ describe("scenarios > admin > settings", () => {
|
||||
// rather than aliasing it with .as()
|
||||
const emailInput = () =>
|
||||
cy
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
.contains(/Email Address for Help Requests/i)
|
||||
.parent()
|
||||
.parent()
|
||||
@@ -139,7 +139,7 @@ describe("scenarios > admin > settings", () => {
|
||||
H.popover().contains("https://").click();
|
||||
|
||||
cy.wait("@httpsCheck");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("It looks like HTTPS is not properly configured");
|
||||
});
|
||||
|
||||
@@ -259,11 +259,11 @@ describe("scenarios > admin > settings", () => {
|
||||
cy.visit("/admin/settings/general");
|
||||
|
||||
cy.wait("@appSettings");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("We're a little lost...").should("not.exist");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/Site name/i);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/Site URL/i);
|
||||
});
|
||||
|
||||
@@ -717,7 +717,7 @@ describe("scenarios > admin > localization", () => {
|
||||
|
||||
// find and open that question
|
||||
cy.visit("/collection/root");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders created before June 1st 2022").click();
|
||||
|
||||
cy.wait("@cardQuery");
|
||||
@@ -753,7 +753,7 @@ describe("scenarios > admin > localization", () => {
|
||||
});
|
||||
|
||||
cy.visit("/collection/root");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("13604").click();
|
||||
|
||||
cy.log("Reported failing on v0.37.0.2 and labeled as `.Regression`");
|
||||
@@ -811,10 +811,10 @@ describe("scenarios > admin > localization", () => {
|
||||
it("should use currency settings for number columns with style set to currency (metabase#10787)", () => {
|
||||
cy.visit("/admin/settings/localization");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Unit of currency");
|
||||
cy.findByDisplayValue("US Dollar").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Euro").click();
|
||||
H.undoToast().findByText("Changes saved").should("be.visible");
|
||||
|
||||
@@ -837,7 +837,7 @@ describe("scenarios > admin > localization", () => {
|
||||
},
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("€10.00");
|
||||
});
|
||||
|
||||
@@ -938,14 +938,14 @@ describe("scenarios > admin > settings > map settings", () => {
|
||||
it("should be able to load a custom map even if a name has not been added yet (#14635)", () => {
|
||||
cy.intercept("GET", "/api/geojson*").as("load");
|
||||
cy.visit("/admin/settings/maps");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Add a map").click();
|
||||
cy.findByPlaceholderText(
|
||||
"Like https://my-mb-server.com/maps/my-map.json",
|
||||
).type(
|
||||
"https://raw.githubusercontent.com/metabase/metabase/master/resources/frontend_client/app/assets/geojson/world.json",
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Load").click();
|
||||
cy.wait("@load").then((interception) => {
|
||||
expect(interception.response.statusCode).to.eq(200);
|
||||
@@ -954,14 +954,14 @@ describe("scenarios > admin > settings > map settings", () => {
|
||||
|
||||
it("should show an informative error when adding an invalid URL", () => {
|
||||
cy.visit("/admin/settings/maps");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Add a map").click();
|
||||
cy.findByPlaceholderText(
|
||||
"Like https://my-mb-server.com/maps/my-map.json",
|
||||
).type("bad-url");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Load").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(
|
||||
"Invalid GeoJSON file location: must either start with http:// or https:// or be a relative path to a file on the classpath. " +
|
||||
"URLs referring to hosts that supply internal hosting metadata are prohibited.",
|
||||
@@ -970,16 +970,16 @@ describe("scenarios > admin > settings > map settings", () => {
|
||||
|
||||
it("should show an informative error when adding a valid URL that does not contain GeoJSON, or is missing required fields", () => {
|
||||
cy.visit("/admin/settings/maps");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Add a map").click();
|
||||
|
||||
// Not GeoJSON
|
||||
cy.findByPlaceholderText(
|
||||
"Like https://my-mb-server.com/maps/my-map.json",
|
||||
).type("https://metabase.com");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Load").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("GeoJSON URL returned invalid content-type");
|
||||
|
||||
// GeoJSON with an unsupported format (not a Feature or FeatureCollection)
|
||||
@@ -988,9 +988,9 @@ describe("scenarios > admin > settings > map settings", () => {
|
||||
.type(
|
||||
"https://raw.githubusercontent.com/metabase/metabase/master/test_resources/test.geojson",
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Load").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Invalid custom GeoJSON: does not contain features");
|
||||
});
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ describe(
|
||||
cy.button("Save and enable").click();
|
||||
cy.wait("@updateLdapSettings");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Success").should("exist");
|
||||
});
|
||||
|
||||
@@ -126,7 +126,7 @@ describe(
|
||||
|
||||
cy.button("Save and enable").click();
|
||||
cy.wait("@updateLdapSettings");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Success").should("exist");
|
||||
});
|
||||
|
||||
@@ -195,9 +195,9 @@ describe(
|
||||
cy.signOut();
|
||||
cy.visit("/auth/login");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Username or email address").should("be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Password").should("be.visible");
|
||||
});
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ describe("scenarios > admin > settings > SSO > SAML", () => {
|
||||
enterSamlSettings();
|
||||
cy.button("Save and enable").click();
|
||||
cy.wait("@updateSamlSettings");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Success").should("exist");
|
||||
|
||||
H.goToAuthOverviewPage();
|
||||
|
||||
@@ -242,7 +242,7 @@ describe("(metabase#46714)", () => {
|
||||
cy.findByLabelText("Filter operator")
|
||||
.should("have.text", "Between")
|
||||
.click();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover().last().findByText("Less than").click();
|
||||
cy.findByLabelText("Filter operator").should("have.text", "Less than");
|
||||
H.popover().findByPlaceholderText("Enter a number").clear().type("1000");
|
||||
|
||||
@@ -40,105 +40,6 @@ describe(
|
||||
},
|
||||
);
|
||||
|
||||
describe(
|
||||
"admin > database > external databases > workspaces",
|
||||
{ tags: ["@external"] },
|
||||
() => {
|
||||
beforeEach(() => {
|
||||
cy.intercept("POST", "/api/database/*/permission/workspace/check").as(
|
||||
"checkPermissions",
|
||||
);
|
||||
});
|
||||
|
||||
it("should allow to enable and disable workspaces in postgres database", () => {
|
||||
H.restore("postgres-writable");
|
||||
cy.signInAsAdmin();
|
||||
H.activateToken("bleeding-edge");
|
||||
H.addPostgresDatabase("Test DB");
|
||||
|
||||
visitDatabase(WRITABLE_DB_ID);
|
||||
|
||||
cy.findByLabelText("Enable workspaces").should("not.be.checked");
|
||||
cy.findByLabelText("Enable workspaces").parent().click();
|
||||
|
||||
cy.wait("@checkPermissions");
|
||||
cy.findByLabelText("Enable workspaces").should("be.checked");
|
||||
|
||||
cy.findByRole("link", { name: "Exit admin" }).click();
|
||||
cy.button("Settings").click();
|
||||
H.popover().findByText("Data studio").click();
|
||||
H.Workspaces.getNewWorkspaceButton().click();
|
||||
cy.findByPlaceholderText("Select a database").click();
|
||||
H.popover().within(() => {
|
||||
cy.findByText("Writable Postgres12").should("be.visible");
|
||||
cy.findByText("Test DB").should("not.exist");
|
||||
});
|
||||
|
||||
cy.go(-3);
|
||||
cy.findByLabelText("Enable workspaces").should("be.checked");
|
||||
cy.findByLabelText("Enable workspaces").parent().click();
|
||||
cy.findByLabelText("Enable workspaces").should("not.be.checked");
|
||||
|
||||
cy.go(3);
|
||||
cy.findByPlaceholderText("No database supports workspaces").should(
|
||||
"be.visible",
|
||||
);
|
||||
});
|
||||
|
||||
it("should not show workspaces setting for unsupported mysql database", () => {
|
||||
H.restore("mysql-writable");
|
||||
cy.signInAsAdmin();
|
||||
H.activateToken("bleeding-edge");
|
||||
|
||||
visitDatabase(WRITABLE_DB_ID);
|
||||
|
||||
cy.findByLabelText("Enable workspaces").should("not.exist");
|
||||
});
|
||||
|
||||
it("should not allow to enable workspaces for a db user that cannot create users/schemas", () => {
|
||||
H.restore("postgres-writable");
|
||||
cy.signInAsAdmin();
|
||||
H.activateToken("bleeding-edge");
|
||||
|
||||
// Create a limited postgres user without CREATE USER/SCHEMA permissions
|
||||
const limitedUser = "limited_user";
|
||||
const limitedPassword = "limited_pass";
|
||||
|
||||
H.queryWritableDB(`
|
||||
DROP USER IF EXISTS ${limitedUser};
|
||||
CREATE USER ${limitedUser} WITH PASSWORD '${limitedPassword}';
|
||||
`);
|
||||
|
||||
// Update the existing database connection to use the limited user
|
||||
cy.request("PUT", `/api/database/${WRITABLE_DB_ID}`, {
|
||||
details: {
|
||||
host: "localhost",
|
||||
port: QA_POSTGRES_PORT,
|
||||
dbname: "writable_db",
|
||||
user: limitedUser,
|
||||
password: limitedPassword,
|
||||
},
|
||||
});
|
||||
|
||||
visitDatabase(WRITABLE_DB_ID);
|
||||
|
||||
cy.findByLabelText("Enable workspaces").should("not.be.checked");
|
||||
cy.findByLabelText("Enable workspaces").parent().click();
|
||||
|
||||
cy.wait("@checkPermissions");
|
||||
|
||||
cy.findByTestId("database-workspaces-section").should(
|
||||
"contain.text",
|
||||
"Failed to initialize workspace isolation",
|
||||
);
|
||||
cy.findByLabelText("Enable workspaces").should("not.be.checked");
|
||||
|
||||
// Cleanup: just drop the postgres user, H.restore() resets the DB connection
|
||||
H.queryWritableDB(`DROP USER IF EXISTS ${limitedUser};`);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
describe("admin > database > add", () => {
|
||||
function toggleFieldWithDisplayName(displayName) {
|
||||
cy.findByLabelText(new RegExp(displayName)).click({ force: true });
|
||||
@@ -188,7 +89,7 @@ describe("admin > database > add", () => {
|
||||
|
||||
cy.visit("/admin/databases/create");
|
||||
// should display a setup help card
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Need help connecting?");
|
||||
|
||||
cy.findByLabelText("Database type").click();
|
||||
@@ -455,11 +356,11 @@ describe("admin > database > add", () => {
|
||||
);
|
||||
|
||||
it("should add MySQL database and redirect to db info page", () => {
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("MySQL").click({ force: true });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Show advanced options").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Additional JDBC connection string options");
|
||||
|
||||
H.typeAndBlurUsingLabel("Display name", "QA MySQL8");
|
||||
@@ -476,7 +377,7 @@ describe("admin > database > add", () => {
|
||||
"allowPublicKeyRetrieval=true",
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Save").should("not.be.disabled").click();
|
||||
|
||||
cy.wait("@createDatabase");
|
||||
@@ -605,7 +506,7 @@ describe("scenarios > admin > databases > exceptions", () => {
|
||||
cy.get("nav").should("contain", "Metabase Admin");
|
||||
// The response still contains the database name,
|
||||
// so there's no reason we can't display it.
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains(/Sample Database/i);
|
||||
// This seems like a reasonable CTA if the database is beyond repair.
|
||||
cy.button("Remove this database").should("not.be.disabled");
|
||||
@@ -700,7 +601,7 @@ describe("scenarios > admin > databases > exceptions", () => {
|
||||
cy.wait("@loadDatabase").then(({ response }) => {
|
||||
expect(response.statusCode).to.eq(404);
|
||||
});
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Not found.");
|
||||
cy.findByRole("table").should("not.exist");
|
||||
});
|
||||
@@ -731,18 +632,18 @@ describe("scenarios > admin > databases > exceptions", () => {
|
||||
cy.visit("/admin/databases");
|
||||
cy.wait("@failedGet");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/Something.s gone wrong/);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(
|
||||
/We.ve run into an error\. You can try refreshing the page, or just go back\./,
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(errorMessage).should("not.be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Show error details").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(errorMessage).should("be.visible");
|
||||
});
|
||||
});
|
||||
@@ -765,7 +666,7 @@ describe("scenarios > admin > databases > sample database", () => {
|
||||
editDatabase();
|
||||
|
||||
// should not display a setup help card
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Need help connecting?").should("not.exist");
|
||||
|
||||
cy.log(
|
||||
@@ -782,7 +683,7 @@ describe("scenarios > admin > databases > sample database", () => {
|
||||
.and("contain", "sample-database.db");
|
||||
|
||||
cy.log("should be possible to modify the connection settings");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Show advanced options").click();
|
||||
// `auto_run_queries` toggle should be ON by default
|
||||
cy.findByLabelText(/Rerun queries for simple explorations/)
|
||||
@@ -801,7 +702,7 @@ describe("scenarios > admin > databases > sample database", () => {
|
||||
cy.findByLabelText(/Choose when syncs and scans happen/).click({
|
||||
force: true,
|
||||
});
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Hourly").click();
|
||||
H.popover().within(() => {
|
||||
cy.findByText("Daily").click({ force: true });
|
||||
@@ -935,14 +836,14 @@ describe("scenarios > admin > databases > sample database", () => {
|
||||
// lets you trigger the manual database schema sync
|
||||
cy.button("Sync database schema").click();
|
||||
cy.wait("@sync_schema");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Sync triggered!");
|
||||
|
||||
// lets you trigger the manual rescan of field values
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Re-scan field values").click();
|
||||
cy.wait("@rescan_values");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Scan triggered!");
|
||||
|
||||
// lets you discard saved field values
|
||||
@@ -1004,7 +905,7 @@ describe("scenarios > admin > databases > sample database", () => {
|
||||
|
||||
cy.location("pathname").should("eq", "/admin/databases/"); // FIXME why the trailing slash?
|
||||
cy.intercept("POST", "/api/database/sample_database").as("sample_database");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Bring the sample database back", {
|
||||
timeout: 10000,
|
||||
}).click();
|
||||
@@ -1094,7 +995,7 @@ describe("add database card", () => {
|
||||
it("should track the click on the card", () => {
|
||||
cy.visit("/browse/databases");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findByTestId("database-browser")
|
||||
.findAllByRole("link")
|
||||
.last()
|
||||
|
||||
@@ -990,9 +990,9 @@ describe("scenarios > admin > datamodel", () => {
|
||||
);
|
||||
|
||||
cy.visit(`/reference/databases/${SAMPLE_DB_ID}/tables/${ORDERS_ID}`);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders").should("be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("New description").should("be.visible");
|
||||
});
|
||||
|
||||
@@ -1009,9 +1009,9 @@ describe("scenarios > admin > datamodel", () => {
|
||||
TableSection.getDescriptionInput().should("have.value", "");
|
||||
|
||||
cy.visit(`/reference/databases/${SAMPLE_DB_ID}/tables/${ORDERS_ID}`);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders").should("be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("No description yet").should("be.visible");
|
||||
});
|
||||
});
|
||||
@@ -1114,9 +1114,9 @@ describe("scenarios > admin > datamodel", () => {
|
||||
cy.visit(
|
||||
`/reference/databases/${SAMPLE_DB_ID}/tables/${ORDERS_ID}/fields/${ORDERS.TOTAL}`,
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Total").should("be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("New description").should("be.visible");
|
||||
});
|
||||
|
||||
@@ -1145,9 +1145,9 @@ describe("scenarios > admin > datamodel", () => {
|
||||
cy.visit(
|
||||
`/reference/databases/${SAMPLE_DB_ID}/tables/${ORDERS_ID}/fields/${ORDERS.TOTAL}`,
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Total").should("be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("No description yet").should("be.visible");
|
||||
});
|
||||
});
|
||||
@@ -1514,9 +1514,9 @@ describe("scenarios > admin > datamodel", () => {
|
||||
cy.visit(
|
||||
`/reference/databases/${SAMPLE_DB_ID}/tables/${ORDERS_ID}/fields/${ORDERS.TOTAL}`,
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Total").should("be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("New description").should("be.visible");
|
||||
});
|
||||
|
||||
@@ -1546,9 +1546,9 @@ describe("scenarios > admin > datamodel", () => {
|
||||
cy.visit(
|
||||
`/reference/databases/${SAMPLE_DB_ID}/tables/${ORDERS_ID}/fields/${ORDERS.TOTAL}`,
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Total").should("be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("No description yet").should("be.visible");
|
||||
});
|
||||
|
||||
@@ -2018,7 +2018,7 @@ describe("scenarios > admin > datamodel", () => {
|
||||
|
||||
cy.log("verify viz");
|
||||
H.openOrdersTable();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Tax (CA$)").should("be.visible");
|
||||
});
|
||||
|
||||
@@ -2581,7 +2581,7 @@ describe("scenarios > admin > datamodel", () => {
|
||||
|
||||
cy.signInAsNormalUser();
|
||||
H.openReviewsTable({ limit: 1 });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Rustic Paper Wallet").should("be.visible");
|
||||
});
|
||||
|
||||
@@ -2817,7 +2817,7 @@ describe("scenarios > admin > datamodel", () => {
|
||||
fieldId: REVIEWS.RATING,
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(CUSTOM_MAPPING_ERROR).should("exist");
|
||||
});
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ describe("issue 17768", () => {
|
||||
H.openReviewsTable({ mode: "notebook" });
|
||||
|
||||
H.summarize({ mode: "notebook" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
|
||||
H.popover().within(() => {
|
||||
|
||||
@@ -272,7 +272,7 @@ describe("scenarios > admin > datamodel > segments", () => {
|
||||
.first()
|
||||
.should("contain", "You edited the description")
|
||||
.and("contain", "Foo");
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.get("@revisions")
|
||||
.last()
|
||||
.should("contain", `You created "${SEGMENT_NAME}"`)
|
||||
|
||||
@@ -11,9 +11,9 @@ describe("scenarios > admin > tools > help", { tags: "@OSS" }, () => {
|
||||
it("should link `Get help` to help", () => {
|
||||
cy.visit("/admin/tools/help");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Metabase Admin");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Get help")
|
||||
.parents("a")
|
||||
.should("have.prop", "href")
|
||||
|
||||
@@ -84,13 +84,13 @@ describe("issue 14636", () => {
|
||||
|
||||
cy.location("search").should("eq", "");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Troubleshooting logs");
|
||||
|
||||
cy.findByLabelText("pagination").findByText("1 - 50").should("be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("field values scanning");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("513");
|
||||
|
||||
cy.findByLabelText("Previous page").should("be.disabled");
|
||||
@@ -103,9 +103,9 @@ describe("issue 14636", () => {
|
||||
.findByText(`51 - ${total}`)
|
||||
.should("be.visible");
|
||||
cy.findByLabelText("pagination").findByText("1 - 50").should("not.exist");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("analyze");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("200");
|
||||
|
||||
cy.findByLabelText("Next page").should("be.disabled");
|
||||
|
||||
@@ -146,7 +146,7 @@ describe("scenarios > binning > binning options", () => {
|
||||
|
||||
getTitle("Count by Total: Auto binned");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Total: Auto binned").click();
|
||||
openBinningListForDimension("Total", "Auto binned");
|
||||
|
||||
@@ -162,7 +162,7 @@ describe("scenarios > binning > binning options", () => {
|
||||
|
||||
getTitle("Count by Created At: Month");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Created At: Month").click();
|
||||
openBinningListForDimension("Created At", "by month");
|
||||
|
||||
@@ -182,7 +182,7 @@ describe("scenarios > binning > binning options", () => {
|
||||
|
||||
getTitle("Count by Longitude: Auto binned");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Longitude: Auto binned").click();
|
||||
openBinningListForDimension("Longitude", "Auto binned");
|
||||
|
||||
@@ -322,7 +322,7 @@ function getAllOptions({ options, isSelected, shouldExpandList } = {}) {
|
||||
// Custom question has two popovers open.
|
||||
// The binning options are in the latest (last) one.
|
||||
// Using `.last()` works even when only one popover is open so it covers both scenarios.
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover()
|
||||
.last()
|
||||
.within(() => {
|
||||
|
||||
@@ -22,20 +22,20 @@ describe("binning related reproductions", () => {
|
||||
cy.findByText("16327").click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a function or metric").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count of rows").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/CREATED_AT/i).realHover();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("by month").click({ force: true });
|
||||
|
||||
// Implicit assertion - it fails if there is more than one instance of the string, which is exactly what we need for this repro
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Day");
|
||||
});
|
||||
|
||||
@@ -71,9 +71,9 @@ describe("binning related reproductions", () => {
|
||||
expect(xhr.response.body.error).not.to.exist;
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by Created At: Year");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("2024");
|
||||
});
|
||||
|
||||
@@ -112,7 +112,7 @@ describe("binning related reproductions", () => {
|
||||
.findByLabelText("Temporal bucket")
|
||||
.realHover()
|
||||
.click();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover().last().findByText("Quarter").click();
|
||||
|
||||
H.getNotebookStep("sort").findByText("CREATED_AT: Quarter");
|
||||
@@ -142,7 +142,7 @@ describe("binning related reproductions", () => {
|
||||
cy.findByText("ID").click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Summarize").click();
|
||||
H.popover().findByText("Count of rows").click();
|
||||
|
||||
@@ -281,11 +281,11 @@ describe("binning related reproductions", () => {
|
||||
it("should work for notebook mode", () => {
|
||||
openSummarizeOptions("Notebook mode");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a function or metric").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count of rows").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
|
||||
H.changeBinningForDimension({
|
||||
@@ -320,9 +320,9 @@ describe("binning related reproductions", () => {
|
||||
});
|
||||
|
||||
H.startNewQuestion();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Saved Questions").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("SQL Binning").click();
|
||||
|
||||
H.visualize();
|
||||
@@ -336,11 +336,11 @@ describe("binning related reproductions", () => {
|
||||
|
||||
cy.wait("@dataset");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by TOTAL: Auto binned");
|
||||
cy.get(".bar").should("have.length.of.at.most", 10);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("-60");
|
||||
});
|
||||
|
||||
@@ -360,9 +360,9 @@ describe("binning related reproductions", () => {
|
||||
expect(xhr.response.body.error).not.to.exist;
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by LONGITUDE: Auto binned");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("170° W");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ describe("scenarios > binning > correctness > longitude", () => {
|
||||
.should("contain", "Longitude")
|
||||
.and("contain", selected);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Done").click();
|
||||
|
||||
getTitle(`Count by Longitude: ${selected}`);
|
||||
@@ -47,7 +47,7 @@ describe("scenarios > binning > correctness > longitude", () => {
|
||||
.should("contain", "Longitude")
|
||||
.and("contain", "Unbinned");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Done").click();
|
||||
|
||||
getTitle("Count by Longitude");
|
||||
|
||||
@@ -81,7 +81,7 @@ describe("scenarios > binning > from a saved QB question with explicit joins", (
|
||||
|
||||
// Make sure time series footer works as well
|
||||
cy.findByTestId("timeseries-bucket-button").contains("Year").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Quarter").click();
|
||||
|
||||
cy.wait("@dataset");
|
||||
@@ -129,11 +129,11 @@ describe("scenarios > binning > from a saved QB question with explicit joins", (
|
||||
cy.findByText("QB Binning").click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a function or metric").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count of rows").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
});
|
||||
|
||||
@@ -153,7 +153,7 @@ describe("scenarios > binning > from a saved QB question with explicit joins", (
|
||||
|
||||
// Make sure time series footer works as well
|
||||
cy.findByTestId("timeseries-bucket-button").contains("Year").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Quarter").click();
|
||||
|
||||
cy.wait("@dataset");
|
||||
@@ -207,11 +207,11 @@ describe("scenarios > binning > from a saved QB question with explicit joins", (
|
||||
|
||||
it("should work for time series", () => {
|
||||
H.tableHeaderClick("People → Birth Date");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Distribution").click();
|
||||
|
||||
// Reproduces metabase#16693
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by People → Birth Date: Month");
|
||||
|
||||
assertOnXYAxisLabels({ xLabel: "People → Birth Date", yLabel: "Count" });
|
||||
@@ -227,11 +227,11 @@ describe("scenarios > binning > from a saved QB question with explicit joins", (
|
||||
|
||||
// Make sure time series footer works as well
|
||||
cy.findByTestId("timeseries-bucket-button").contains("Month").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Quarter").click();
|
||||
|
||||
// Reproduces metabase#16693
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by People → Birth Date: Quarter");
|
||||
|
||||
H.echartsContainer()
|
||||
@@ -246,18 +246,18 @@ describe("scenarios > binning > from a saved QB question with explicit joins", (
|
||||
|
||||
it("should work for number", () => {
|
||||
H.tableHeaderClick("Products → Price");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Distribution").click();
|
||||
|
||||
// Reproduces metabase#16693
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by Products → Price: Auto binned");
|
||||
|
||||
assertOnXYAxisLabels({ xLabel: "Products → Price", yLabel: "Count" });
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("12.5");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("25");
|
||||
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
@@ -265,11 +265,11 @@ describe("scenarios > binning > from a saved QB question with explicit joins", (
|
||||
|
||||
it("should work for longitude", () => {
|
||||
H.tableHeaderClick("People → Longitude");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Distribution").click();
|
||||
|
||||
// Reproduces metabase#16693
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by People → Longitude: Auto binned");
|
||||
|
||||
assertOnXYAxisLabels({
|
||||
@@ -277,9 +277,9 @@ describe("scenarios > binning > from a saved QB question with explicit joins", (
|
||||
yLabel: "Count",
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("170° W");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("160° W");
|
||||
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
|
||||
@@ -35,7 +35,7 @@ describe("scenarios > binning > from a saved QB question using implicit joins",
|
||||
|
||||
// Make sure time series assertQueryBuilderState works as well
|
||||
cy.findByTestId("timeseries-bucket-button").contains("Year").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Month").click();
|
||||
|
||||
cy.get("[data-testid=cell-data]")
|
||||
@@ -74,16 +74,16 @@ describe("scenarios > binning > from a saved QB question using implicit joins",
|
||||
beforeEach(() => {
|
||||
cy.visit(`/question/${ORDERS_QUESTION_ID}/notebook`);
|
||||
H.summarize({ mode: "notebook" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count of rows").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
// Click "Order" accordion to collapse it and expose the other tables
|
||||
H.popover().findByText("Orders").click();
|
||||
});
|
||||
|
||||
it("should work for time series", () => {
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("User").click();
|
||||
cy.findByPlaceholderText("Find...").type("birth");
|
||||
|
||||
@@ -101,7 +101,7 @@ describe("scenarios > binning > from a saved QB question using implicit joins",
|
||||
|
||||
// Make sure time series assertQueryBuilderStateter works as well
|
||||
cy.findByTestId("timeseries-bucket-button").contains("Year").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Month").click();
|
||||
|
||||
cy.get("[data-testid=cell-data]")
|
||||
@@ -110,7 +110,7 @@ describe("scenarios > binning > from a saved QB question using implicit joins",
|
||||
});
|
||||
|
||||
it("should work for number", () => {
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Product").click();
|
||||
|
||||
H.changeBinningForDimension({
|
||||
@@ -127,7 +127,7 @@ describe("scenarios > binning > from a saved QB question using implicit joins",
|
||||
});
|
||||
|
||||
it("should work for longitude", () => {
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("User").click();
|
||||
cy.findByPlaceholderText("Find...").type("longitude");
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ describe("scenarios > binning > binning options", () => {
|
||||
getTitle("Count by Total: 50 bins");
|
||||
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("70");
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ describe("scenarios > binning > binning options", () => {
|
||||
getTitle("Count by Created At: Quarter");
|
||||
|
||||
H.cartesianChartCircle();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Q1 2023");
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("scenarios > binning > binning options", () => {
|
||||
getTitle("Count by Longitude: 20°");
|
||||
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("180° W");
|
||||
});
|
||||
});
|
||||
@@ -69,7 +69,7 @@ describe("scenarios > binning > binning options", () => {
|
||||
getTitle("Count by Total: 50 bins");
|
||||
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("70");
|
||||
});
|
||||
|
||||
@@ -85,7 +85,7 @@ describe("scenarios > binning > binning options", () => {
|
||||
getTitle("Count by Created At: Quarter");
|
||||
|
||||
H.cartesianChartCircle();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Q1 2023");
|
||||
});
|
||||
|
||||
@@ -101,7 +101,7 @@ describe("scenarios > binning > binning options", () => {
|
||||
getTitle("Count by Longitude: 20°");
|
||||
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("180° W");
|
||||
});
|
||||
});
|
||||
@@ -110,39 +110,39 @@ describe("scenarios > binning > binning options", () => {
|
||||
it("should work for number", () => {
|
||||
H.openTable({ table: ORDERS_ID });
|
||||
H.tableHeaderClick("Total");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Distribution").click();
|
||||
|
||||
getTitle("Count by Total: Auto binned");
|
||||
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("60");
|
||||
});
|
||||
|
||||
it("should work for time series", () => {
|
||||
H.openTable({ table: ORDERS_ID });
|
||||
H.tableHeaderClick("Created At");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Distribution").click();
|
||||
|
||||
getTitle("Count by Created At: Month");
|
||||
|
||||
H.cartesianChartCircle();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("January 2023");
|
||||
});
|
||||
|
||||
it("should work for longitude/latitude", () => {
|
||||
H.openTable({ table: PEOPLE_ID });
|
||||
H.tableHeaderClick("Longitude");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Distribution").click();
|
||||
|
||||
getTitle("Count by Longitude: Auto binned");
|
||||
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("170° W");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ describe("scenarios > binning > from a saved sql question", () => {
|
||||
|
||||
waitAndAssertOnRequest("@dataset");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by CREATED_AT: Year");
|
||||
H.cartesianChartCircle();
|
||||
});
|
||||
@@ -73,7 +73,7 @@ describe("scenarios > binning > from a saved sql question", () => {
|
||||
|
||||
waitAndAssertOnRequest("@dataset");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by TOTAL: 50 bins");
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
});
|
||||
@@ -87,7 +87,7 @@ describe("scenarios > binning > from a saved sql question", () => {
|
||||
|
||||
waitAndAssertOnRequest("@dataset");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by LONGITUDE: 10°");
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
});
|
||||
@@ -108,9 +108,9 @@ describe("scenarios > binning > from a saved sql question", () => {
|
||||
},
|
||||
{ mode: "notebook" },
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Summarize").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
});
|
||||
|
||||
@@ -121,7 +121,7 @@ describe("scenarios > binning > from a saved sql question", () => {
|
||||
toBinning: "Year",
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by CREATED_AT: Year");
|
||||
|
||||
H.visualize((response) => {
|
||||
@@ -138,7 +138,7 @@ describe("scenarios > binning > from a saved sql question", () => {
|
||||
toBinning: "50 bins",
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by TOTAL: 50 bins");
|
||||
|
||||
H.visualize((response) => {
|
||||
@@ -155,7 +155,7 @@ describe("scenarios > binning > from a saved sql question", () => {
|
||||
toBinning: "Bin every 10 degrees",
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by LONGITUDE: 10°");
|
||||
|
||||
H.visualize((response) => {
|
||||
@@ -177,46 +177,46 @@ describe("scenarios > binning > from a saved sql question", () => {
|
||||
|
||||
it("should work for time series", () => {
|
||||
H.tableHeaderClick("CREATED_AT");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Distribution").click();
|
||||
|
||||
assertOnXYAxisLabels({ xLabel: "CREATED_AT", yLabel: "Count" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by CREATED_AT: Month");
|
||||
H.cartesianChartCircle();
|
||||
|
||||
// Open a popover with bucket options from the time series footer
|
||||
cy.findByTestId("timeseries-bucket-button").contains("Month").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Quarter").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by CREATED_AT: Quarter");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Q1 2023");
|
||||
});
|
||||
|
||||
it("should work for number", () => {
|
||||
H.tableHeaderClick("TOTAL");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Distribution").click();
|
||||
|
||||
assertOnXYAxisLabels({ xLabel: "TOTAL", yLabel: "Count" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by TOTAL: Auto binned");
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
});
|
||||
|
||||
it("should work for longitude", () => {
|
||||
H.tableHeaderClick("LONGITUDE");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Distribution").click();
|
||||
|
||||
assertOnXYAxisLabels({ xLabel: "LONGITUDE", yLabel: "Count" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count by LONGITUDE: Auto binned");
|
||||
H.chartPathWithFillColor("#509EE3");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("170° W");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -156,7 +156,7 @@ describe("scenarios > collection pinned items overview", () => {
|
||||
H.openPinnedItemMenu(DASHBOARD_NAME);
|
||||
H.popover().findByText("Move").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`Move "${DASHBOARD_NAME}"?`).should("be.visible");
|
||||
});
|
||||
|
||||
@@ -169,7 +169,7 @@ describe("scenarios > collection pinned items overview", () => {
|
||||
H.openPinnedItemMenu(DASHBOARD_NAME);
|
||||
H.popover().findByText("Duplicate").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`Duplicate "${DASHBOARD_NAME}" and its questions`).should(
|
||||
"be.visible",
|
||||
);
|
||||
@@ -186,7 +186,7 @@ describe("scenarios > collection pinned items overview", () => {
|
||||
cy.wait("@getPinnedItems");
|
||||
|
||||
H.getPinnedSection().should("not.exist");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(DASHBOARD_NAME).should("not.exist");
|
||||
});
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ describe("scenarios > collection defaults", () => {
|
||||
});
|
||||
|
||||
// 2. Ensure we show the helpful tooltip with the full (long) collection name
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Fifth collection with a very long name").realHover();
|
||||
cy.findByRole("tooltip", {
|
||||
name: /Fifth collection with a very long name/,
|
||||
@@ -355,7 +355,7 @@ describe("scenarios > collection defaults", () => {
|
||||
},
|
||||
);
|
||||
visitRootCollection();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("me@email.com").trigger("mouseenter");
|
||||
cy.findByRole("tooltip").should("not.exist");
|
||||
});
|
||||
@@ -379,7 +379,7 @@ describe("scenarios > collection defaults", () => {
|
||||
},
|
||||
);
|
||||
visitRootCollection();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("averyverylongemail@veryverylongdomain.com").trigger(
|
||||
"mouseenter",
|
||||
);
|
||||
@@ -487,7 +487,7 @@ describe("scenarios > collection defaults", () => {
|
||||
H.createNativeQuestion(questionDetails);
|
||||
|
||||
visitRootCollection();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders in a dashboard");
|
||||
});
|
||||
|
||||
@@ -496,20 +496,20 @@ describe("scenarios > collection defaults", () => {
|
||||
|
||||
H.visitCollection(FIRST_COLLECTION_ID);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders").as("dragSubject");
|
||||
|
||||
H.navigationSidebar().findByText("Our analytics").as("dropTarget");
|
||||
|
||||
H.dragAndDrop("dragSubject", "dropTarget");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Moved question");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders").should("not.exist");
|
||||
|
||||
visitRootCollection();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders");
|
||||
});
|
||||
|
||||
@@ -564,16 +564,16 @@ describe("scenarios > collection defaults", () => {
|
||||
|
||||
// Even if user tries to navigate directly to the root collection, we have to make sure its content is not shown
|
||||
cy.visit("/collection/root");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("You don't have permissions to do that.");
|
||||
});
|
||||
|
||||
it("should be able to choose a child collection when saving a question (metabase#14052)", () => {
|
||||
H.openOrdersTable();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Save").click();
|
||||
// Click to choose which collection should this question be saved to
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(revokedUsersPersonalCollectionName).click();
|
||||
H.pickEntity({ path: [revokedUsersPersonalCollectionName] });
|
||||
H.pickEntity({ path: ["Collections", "Child"] });
|
||||
@@ -711,7 +711,7 @@ describe("scenarios > collection defaults", () => {
|
||||
|
||||
// Select one
|
||||
selectItemUsingCheckbox("Orders");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("1 item selected").should("be.visible");
|
||||
cy.icon("dash").should("exist");
|
||||
cy.icon("check").should("exist");
|
||||
@@ -725,7 +725,7 @@ describe("scenarios > collection defaults", () => {
|
||||
cy.findByLabelText("Select all items").click();
|
||||
|
||||
cy.icon("check").should("not.exist");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/item(s)? selected/).should("not.exist");
|
||||
});
|
||||
|
||||
@@ -734,16 +734,16 @@ describe("scenarios > collection defaults", () => {
|
||||
collection_id: ADMIN_PERSONAL_COLLECTION_ID,
|
||||
});
|
||||
cy.visit("/collection/root");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Your personal collection").click();
|
||||
|
||||
selectItemUsingCheckbox("Orders");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("1 item selected").should("be.visible");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Our analytics").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/item(s)? selected/).should("not.exist");
|
||||
});
|
||||
});
|
||||
@@ -758,7 +758,7 @@ describe("scenarios > collection defaults", () => {
|
||||
.button("Move to trash")
|
||||
.click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders").should("not.exist");
|
||||
cy.findByTestId("toast-card").should("not.exist");
|
||||
});
|
||||
@@ -776,21 +776,21 @@ describe("scenarios > collection defaults", () => {
|
||||
cy.button("Move").click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders").should("not.exist");
|
||||
cy.findByTestId("toast-card").should("not.exist");
|
||||
|
||||
// Check that items were actually moved
|
||||
H.navigationSidebar().findByText("First collection").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Undo").click();
|
||||
H.navigationSidebar().findByText("Our analytics").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders").should("be.visible");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Undo").should("not.exist");
|
||||
});
|
||||
|
||||
@@ -995,7 +995,7 @@ describe("scenarios > collection items listing", () => {
|
||||
|
||||
function assertCollectionItemsOrder(testId, names) {
|
||||
for (let index = 0; index < names.length; ++index) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId(testId).eq(index).should("have.text", names[index]);
|
||||
}
|
||||
}
|
||||
@@ -1067,7 +1067,7 @@ describe("scenarios > collection items listing", () => {
|
||||
visitRootCollection();
|
||||
|
||||
// First page
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`1 - ${PAGE_SIZE}`);
|
||||
cy.findByTestId("pagination-total").should("have.text", TOTAL_ITEMS);
|
||||
cy.findAllByTestId("collection-entry").should("have.length", PAGE_SIZE);
|
||||
@@ -1076,7 +1076,7 @@ describe("scenarios > collection items listing", () => {
|
||||
cy.wait("@getCollectionItems");
|
||||
|
||||
// Second page
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${PAGE_SIZE + 1} - ${TOTAL_ITEMS}`);
|
||||
cy.findByTestId("pagination-total").should("have.text", TOTAL_ITEMS);
|
||||
cy.findAllByTestId("collection-entry").should(
|
||||
@@ -1088,7 +1088,7 @@ describe("scenarios > collection items listing", () => {
|
||||
cy.findByLabelText("Previous page").click();
|
||||
|
||||
// First page
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`1 - ${PAGE_SIZE}`);
|
||||
cy.findByTestId("pagination-total").should("have.text", TOTAL_ITEMS);
|
||||
cy.findAllByTestId("collection-entry").should("have.length", PAGE_SIZE);
|
||||
@@ -1259,7 +1259,7 @@ describe("scenarios > collection items listing", () => {
|
||||
|
||||
visitRootCollection();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`1 - ${PAGE_SIZE}`);
|
||||
|
||||
cy.findByLabelText("Next page").click();
|
||||
@@ -1268,7 +1268,7 @@ describe("scenarios > collection items listing", () => {
|
||||
toggleSortingFor(/Last edited at/i);
|
||||
cy.wait("@getCollectionItems");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`1 - ${PAGE_SIZE}`);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@ describe("collection permissions", () => {
|
||||
H.appBar().within(() => {
|
||||
cy.icon("add").click();
|
||||
});
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Dashboard").click();
|
||||
cy.findByLabelText(/Which collection/).findByText(
|
||||
"Second collection",
|
||||
@@ -48,7 +48,7 @@ describe("collection permissions", () => {
|
||||
onlyOn(user === "admin", () => {
|
||||
it("should offer to save dashboard to root collection from a dashboard page (metabase#16832)", () => {
|
||||
cy.visit("/collection/root");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders in a dashboard").click();
|
||||
H.appBar().within(() => {
|
||||
cy.icon("add").click();
|
||||
@@ -137,7 +137,7 @@ describe("collection permissions", () => {
|
||||
cy.findByText("Trash").click();
|
||||
});
|
||||
cy.location("pathname").should("eq", "/trash");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders");
|
||||
});
|
||||
});
|
||||
@@ -146,7 +146,7 @@ describe("collection permissions", () => {
|
||||
it("shouldn't be able to archive/edit root or personal collection", () => {
|
||||
cy.visit("/collection/root");
|
||||
cy.icon("edit").should("not.exist");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Your personal collection").click();
|
||||
cy.icon("edit").should("not.exist");
|
||||
});
|
||||
@@ -168,7 +168,7 @@ describe("collection permissions", () => {
|
||||
|
||||
H.openCollectionMenu();
|
||||
H.popover().within(() =>
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- linter erroring for no reason
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- linter erroring for no reason
|
||||
cy.findByText("Move to trash").click(),
|
||||
);
|
||||
H.modal().findByText("Move to trash").click();
|
||||
@@ -184,14 +184,14 @@ describe("collection permissions", () => {
|
||||
});
|
||||
|
||||
// While we're here, we can test unarchiving the collection as well
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Trashed collection");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Undo").click();
|
||||
|
||||
cy.wait("@editCollection");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(
|
||||
"Sorry, you don’t have permission to see that.",
|
||||
).should("not.exist");
|
||||
@@ -297,7 +297,7 @@ describe("collection permissions", () => {
|
||||
it("should not show pins or a helper text (metabase#20043)", () => {
|
||||
cy.visit("/collection/root");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders in a dashboard");
|
||||
cy.icon("pin").should("not.exist");
|
||||
});
|
||||
@@ -316,7 +316,7 @@ describe("collection permissions", () => {
|
||||
it("should not be able to use bulk actions on collection items (metabase#16490)", () => {
|
||||
cy.visit("/collection/root");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders")
|
||||
.closest("tr")
|
||||
.within(() => {
|
||||
@@ -324,7 +324,7 @@ describe("collection permissions", () => {
|
||||
cy.findByRole("checkbox").should("not.exist");
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Orders in a dashboard")
|
||||
.closest("tr")
|
||||
.within(() => {
|
||||
@@ -338,7 +338,7 @@ describe("collection permissions", () => {
|
||||
const { first_name, last_name } = USERS[user];
|
||||
cy.visit(route);
|
||||
cy.icon("add").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Dashboard").click();
|
||||
|
||||
// Coming from the root collection, the initial offered collection will be "Our analytics" (read-only access)
|
||||
@@ -374,7 +374,7 @@ describe("collection permissions", () => {
|
||||
|
||||
H.startNewNativeQuestion();
|
||||
H.NativeEditor.type("select * from people");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Save").click();
|
||||
|
||||
cy.findByLabelText(/Where do you want to save this/).findByText(
|
||||
|
||||
@@ -164,7 +164,7 @@ describe("personal collections", () => {
|
||||
});
|
||||
|
||||
cy.visit(`/collection/${NO_DATA_PERSONAL_COLLECTION_ID}`);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Foo");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ describe("revision history", () => {
|
||||
|
||||
openRevisionHistory();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/created this/);
|
||||
|
||||
cy.findAllByText("Revert").should("not.exist");
|
||||
@@ -138,7 +138,7 @@ describe("revision history", () => {
|
||||
expect(body.cause).not.to.exist;
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains(/^Orders$/);
|
||||
});
|
||||
|
||||
@@ -151,7 +151,7 @@ describe("revision history", () => {
|
||||
cy.findByRole("tab", { name: "History" }).click();
|
||||
|
||||
// Last revert is the original state
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("question-revert-button").last().click();
|
||||
|
||||
cy.wait("@revert").then(({ response: { statusCode, body } }) => {
|
||||
@@ -159,7 +159,7 @@ describe("revision history", () => {
|
||||
expect(body.cause).not.to.exist;
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains(/^Orders$/);
|
||||
});
|
||||
});
|
||||
@@ -191,7 +191,7 @@ describe("revision history", () => {
|
||||
});
|
||||
|
||||
function clickRevert(event_name, index = 0) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByLabelText(event_name).eq(index).click();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ describe("scenarios > collections > trash", () => {
|
||||
|
||||
cy.log("should show trash at bottom of the side navbar");
|
||||
H.navigationSidebar().within(() => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("sidebar-collection-link-root")
|
||||
.last()
|
||||
.as("sidebar-trash-link")
|
||||
|
||||
@@ -380,7 +380,7 @@ describe("Upload Table Cleanup/Management", { tags: "@external" }, () => {
|
||||
|
||||
// multiple delete
|
||||
cy.findAllByRole("checkbox").first().click();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByRole("checkbox").last().click();
|
||||
});
|
||||
|
||||
@@ -459,7 +459,7 @@ function uploadToExisting({
|
||||
|
||||
cy.wait(uploadEndpoints[uploadMode]);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByRole("status")
|
||||
.last()
|
||||
.findByText(/Data (added|replaced)/i, {
|
||||
|
||||
@@ -79,7 +79,7 @@ describe("scenarios > question > custom column > expression shortcuts > combine"
|
||||
"123.45678901234567 123.45678901234567 email@example.com",
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByLabelText("Remove column").last().click();
|
||||
|
||||
cy.findByTestId("combine-example").should(
|
||||
@@ -161,11 +161,11 @@ function selectCombineColumns() {
|
||||
|
||||
function selectColumn(index: number, table: string, name?: string) {
|
||||
H.expressionEditorWidget().within(() => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("column-input").eq(index).click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover()
|
||||
.last()
|
||||
.within(() => {
|
||||
|
||||
@@ -14,11 +14,11 @@ function selectCombineColumns() {
|
||||
|
||||
function selectColumn(index: number, table: string, name?: string) {
|
||||
H.expressionEditorWidget().within(() => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("column-input").eq(index).click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover()
|
||||
.last()
|
||||
.within(() => {
|
||||
@@ -157,7 +157,7 @@ describe("scenarios > question > custom column > expression shortcuts > extract"
|
||||
|
||||
H.expressionEditorWidget().button("Done").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("notebook-cell-item").last().click();
|
||||
selectExtractColumn();
|
||||
|
||||
@@ -302,7 +302,7 @@ describe("scenarios > question > custom column > expression shortcuts > combine"
|
||||
"123.45678901234567 123.45678901234567 email@example.com",
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByLabelText("Remove column").last().click();
|
||||
|
||||
cy.findByTestId("combine-example").should(
|
||||
|
||||
@@ -55,7 +55,7 @@ describe("issue 13289", () => {
|
||||
|
||||
H.openOrdersTable({ mode: "notebook" });
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Custom column").click();
|
||||
|
||||
// Add custom column that will be used later in summarize (group by)
|
||||
@@ -65,15 +65,15 @@ describe("issue 13289", () => {
|
||||
|
||||
it("should allow 'zoom in' drill-through when grouped by custom column (metabase#13289)", () => {
|
||||
H.summarize({ mode: "notebook" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count of rows").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
|
||||
H.popover().findByText(CC_NAME).click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.icon("add").last().click();
|
||||
|
||||
H.popover().within(() => {
|
||||
@@ -88,14 +88,14 @@ describe("issue 13289", () => {
|
||||
.click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("See this month by week").click();
|
||||
cy.wait("@dataset");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("There was a problem with your question").should("not.exist");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Created At is Sep 1–30, 2022");
|
||||
});
|
||||
});
|
||||
@@ -154,7 +154,7 @@ describe(
|
||||
cy.signInAsAdmin();
|
||||
|
||||
H.startNewQuestion();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(PG_DB_NAME).should("be.visible").click();
|
||||
cy.findByTextEnsureVisible("People").click();
|
||||
});
|
||||
@@ -208,9 +208,9 @@ describe("issue 14843", () => {
|
||||
|
||||
H.visualize();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(`${CC_NAME} is not equal to 3`);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Rye").should("not.exist");
|
||||
});
|
||||
});
|
||||
@@ -241,7 +241,7 @@ describe("issue 18069", () => {
|
||||
|
||||
it("should not allow choosing text fields for SUM (metabase#18069)", () => {
|
||||
H.summarize({ mode: "notebook" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Sum of ...").click();
|
||||
|
||||
H.popover().within(() => {
|
||||
@@ -261,7 +261,7 @@ describe("issue 18069", () => {
|
||||
|
||||
H.visualize();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("1,041.45");
|
||||
});
|
||||
});
|
||||
@@ -323,10 +323,10 @@ describe("issue 18747", () => {
|
||||
addNumberParameterToDashboard();
|
||||
mapParameterToCustomColumn();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Save").click();
|
||||
// wait for saving to finish
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("You're editing this dashboard.").should("not.exist");
|
||||
|
||||
addValueToParameterFilter();
|
||||
@@ -369,10 +369,10 @@ describe("issue 18814", () => {
|
||||
H.openNotebook();
|
||||
|
||||
cy.icon("sum").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Count of rows").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
H.popover().contains(ccName).click();
|
||||
|
||||
@@ -626,11 +626,11 @@ describe("issue 21513", () => {
|
||||
H.summarize({ mode: "notebook" });
|
||||
H.popover().findByText("Count of rows").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
H.popover().findByText("Category").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Custom column").click();
|
||||
H.enterCustomColumnDetails({
|
||||
formula: "[Count] * 2",
|
||||
@@ -683,9 +683,9 @@ describe("issue 23862", () => {
|
||||
);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Small");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("-36.53");
|
||||
});
|
||||
});
|
||||
@@ -716,13 +716,13 @@ describe("issue 24922", () => {
|
||||
it("should allow segments in case custom expressions (metabase#24922)", () => {
|
||||
H.openOrdersTable({ mode: "notebook" });
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Custom column").click();
|
||||
H.enterCustomColumnDetails(customColumnDetails);
|
||||
cy.button("Done").click();
|
||||
|
||||
H.visualize();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("CustomColumn").should("be.visible");
|
||||
});
|
||||
});
|
||||
@@ -786,7 +786,7 @@ describe("issue 25189", { tags: "@skip" }, () => {
|
||||
});
|
||||
|
||||
cy.wait("@dataset");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("No results!");
|
||||
|
||||
// 3. We shouldn't see duplication in the breakout fields
|
||||
@@ -932,7 +932,7 @@ describe("issue 42949", { tags: "@skip" }, () => {
|
||||
cy.button("Add column").click();
|
||||
H.popover().findByText("Combine columns").click();
|
||||
H.popover().findAllByTestId("column-input").eq(0).click();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover()
|
||||
.last()
|
||||
.within(() => {
|
||||
@@ -979,7 +979,7 @@ describe("issue 42949", { tags: "@skip" }, () => {
|
||||
H.popover().findByText("Extract part of column").should("not.exist");
|
||||
H.popover().findByText("Combine columns").click();
|
||||
H.popover().findAllByTestId("column-input").eq(0).click();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover().last().findByText("N").should("be.visible");
|
||||
});
|
||||
|
||||
@@ -1008,7 +1008,7 @@ describe("issue 42949", { tags: "@skip" }, () => {
|
||||
H.popover().findByText("Extract part of column").should("not.exist");
|
||||
H.popover().findByText("Combine columns").click();
|
||||
H.popover().findAllByTestId("column-input").eq(0).click();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover().last().findByText("'abc'").should("be.visible");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ describe("scenarios > question > custom column", () => {
|
||||
|
||||
H.visualize();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("There was a problem with your question").should("not.exist");
|
||||
cy.findByTestId("query-visualization-root").contains("Math");
|
||||
});
|
||||
@@ -179,7 +179,7 @@ describe("scenarios > question > custom column", () => {
|
||||
|
||||
H.summarize();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Group by")
|
||||
.parent()
|
||||
.findByText("Math")
|
||||
@@ -227,7 +227,7 @@ describe("scenarios > question > custom column", () => {
|
||||
|
||||
// TODO: There isn't a single unique parent that can be used to scope this icon within
|
||||
// (a good candidate would be `.NotebookCell`)
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.icon("add")
|
||||
.last() // This is brittle.
|
||||
.click();
|
||||
@@ -237,14 +237,14 @@ describe("scenarios > question > custom column", () => {
|
||||
cy.findByText("Total").click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick a column to group by").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Created At").click();
|
||||
|
||||
// Add custom column based on previous aggregates
|
||||
const columnName = "MegaTotal";
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Custom column").click();
|
||||
|
||||
H.enterCustomColumnDetails({
|
||||
@@ -255,7 +255,7 @@ describe("scenarios > question > custom column", () => {
|
||||
|
||||
H.visualize();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("There was a problem with your question").should("not.exist");
|
||||
// This is a pre-save state of the question but the column name should appear
|
||||
// both in tabular and graph views (regardless of which one is currently selected)
|
||||
@@ -265,7 +265,7 @@ describe("scenarios > question > custom column", () => {
|
||||
it("should not return same results for columns with the same name (metabase#12649)", () => {
|
||||
H.openOrdersTable({ mode: "notebook" });
|
||||
// join with Products
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Join data").click();
|
||||
|
||||
H.miniPickerBrowseAll().click();
|
||||
@@ -275,7 +275,7 @@ describe("scenarios > question > custom column", () => {
|
||||
});
|
||||
|
||||
// add custom column
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Custom column").click();
|
||||
H.enterCustomColumnDetails({ formula: "1 + 1", name: "x" });
|
||||
cy.button("Done").click();
|
||||
@@ -323,7 +323,7 @@ describe("scenarios > question > custom column", () => {
|
||||
{ visitQuestion: true },
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(CC_NAME);
|
||||
});
|
||||
|
||||
@@ -359,7 +359,7 @@ describe("scenarios > question > custom column", () => {
|
||||
|
||||
cy.log("Regression since v0.37.1 - it works on v0.37.0");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains(`Sum of ${CC_NAME}`);
|
||||
H.cartesianChartCircle().should("have.length.of.at.least", 8);
|
||||
});
|
||||
@@ -382,11 +382,11 @@ describe("scenarios > question > custom column", () => {
|
||||
{ visitQuestion: true },
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("13634");
|
||||
|
||||
cy.log("Reported failing in v0.34.3, v0.35.4, v0.36.8.2, v0.37.0.2");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Foo Bar");
|
||||
cy.findAllByText("57,911");
|
||||
});
|
||||
@@ -418,13 +418,13 @@ describe("scenarios > question > custom column", () => {
|
||||
.should("have.text", "1")
|
||||
.click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(/Subtotal is greater than 0/i)
|
||||
.parent()
|
||||
.find(".Icon-close")
|
||||
.click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(CC_NAME);
|
||||
});
|
||||
|
||||
@@ -447,9 +447,9 @@ describe("scenarios > question > custom column", () => {
|
||||
{ visitQuestion: true },
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(CC_NAME);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Gizmo2");
|
||||
});
|
||||
|
||||
@@ -535,9 +535,9 @@ describe("scenarios > question > custom column", () => {
|
||||
{ callback: (xhr) => expect(xhr.response.body.error).not.to.exist },
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(CC_NAME);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("37.65");
|
||||
});
|
||||
|
||||
@@ -607,7 +607,7 @@ describe("scenarios > question > custom column", () => {
|
||||
});
|
||||
|
||||
cy.wait("@dataset");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Showing 487 rows").should("be.visible");
|
||||
});
|
||||
|
||||
@@ -1180,7 +1180,7 @@ describe("scenarios > question > custom column > error feedback", () => {
|
||||
cy.signInAsAdmin();
|
||||
|
||||
H.openProductsTable({ mode: "notebook" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Custom column").click();
|
||||
});
|
||||
|
||||
@@ -1190,7 +1190,7 @@ describe("scenarios > question > custom column > error feedback", () => {
|
||||
name: "Non-existent",
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains(/^Unknown column: abcdef/i);
|
||||
});
|
||||
|
||||
@@ -1200,7 +1200,7 @@ describe("scenarios > question > custom column > error feedback", () => {
|
||||
name: "BadSubstring",
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains(/positive integer/i);
|
||||
});
|
||||
});
|
||||
@@ -1215,7 +1215,7 @@ describe("scenarios > question > custom column > expression editor", () => {
|
||||
cy.viewport(1280, 800);
|
||||
|
||||
H.openOrdersTable({ mode: "notebook" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Custom column").click();
|
||||
|
||||
H.enterCustomColumnDetails({
|
||||
@@ -1236,7 +1236,7 @@ describe("scenarios > question > custom column > expression editor", () => {
|
||||
it("should not erase Custom column formula and Custom column name when expression is incomplete (metabase#16126)", () => {
|
||||
H.CustomExpressionEditor.type("{movetoend}{backspace}").blur();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Expected expression");
|
||||
cy.button("Done").should("be.disabled");
|
||||
});
|
||||
@@ -1254,7 +1254,7 @@ describe("scenarios > question > custom column > help text", () => {
|
||||
cy.signInAsAdmin();
|
||||
|
||||
H.openProductsTable({ mode: "notebook" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Custom column").click();
|
||||
});
|
||||
|
||||
@@ -1420,7 +1420,7 @@ describe("scenarios > question > custom column > exiting the editor", () => {
|
||||
cy.signInAsAdmin();
|
||||
|
||||
H.openProductsTable({ mode: "notebook" });
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Custom column").click();
|
||||
});
|
||||
|
||||
@@ -1553,13 +1553,13 @@ describe("scenarios > question > custom column > path", () => {
|
||||
});
|
||||
|
||||
function assertTableData({ title, value }) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.tableInteractive()
|
||||
.findAllByTestId("header-cell")
|
||||
.last()
|
||||
.should("have.text", title);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.tableInteractiveBody()
|
||||
.findAllByTestId("cell-data")
|
||||
.last()
|
||||
@@ -1747,13 +1747,13 @@ describe("scenarios > question > custom column > splitPart", () => {
|
||||
});
|
||||
|
||||
function assertTableData({ title, value }) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.tableInteractive()
|
||||
.findAllByTestId("header-cell")
|
||||
.last()
|
||||
.should("have.text", title);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.tableInteractiveBody()
|
||||
.findAllByTestId("cell-data")
|
||||
.last()
|
||||
|
||||
@@ -2124,7 +2124,7 @@ describe("scenarios > dashboard > dashboard cards > click behavior", () => {
|
||||
H.popover().findByText("User → Longitude: 10°").click();
|
||||
|
||||
// 1st stage - Products (implicit join with Reviews)
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getClickMapping("Product → Vendor").last().click();
|
||||
H.popover().findByText("Product → Category").click();
|
||||
|
||||
@@ -2141,7 +2141,7 @@ describe("scenarios > dashboard > dashboard cards > click behavior", () => {
|
||||
H.popover().findByText("ID").click();
|
||||
|
||||
// 2nd stage - Aggregations & breakouts
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
getClickMapping("Count").last().click();
|
||||
H.popover().findByText("User → Longitude: 10°").click();
|
||||
|
||||
@@ -2754,7 +2754,7 @@ describe("scenarios > dashboard > dashboard cards > click behavior", () => {
|
||||
});
|
||||
|
||||
const clickLineChartPoint = () => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.cartesianChartCircle()
|
||||
.eq(POINT_INDEX)
|
||||
/**
|
||||
@@ -2934,7 +2934,7 @@ const testChangingBackToDefaultBehavior = () => {
|
||||
};
|
||||
|
||||
const getTableCell = (index) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return cy
|
||||
.findAllByRole("row")
|
||||
.eq(POINT_INDEX)
|
||||
@@ -3008,7 +3008,7 @@ function getClickMapping(columnName) {
|
||||
function verifyAvailableClickTargetColumns(columns) {
|
||||
cy.get("aside").within(() => {
|
||||
for (let index = 0; index < columns.length; ++index) {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("click-target-column")
|
||||
.eq(index)
|
||||
.should("have.text", columns[index]);
|
||||
|
||||
@@ -93,9 +93,9 @@ describe("issue 15993", () => {
|
||||
// Drill-through
|
||||
cy.findAllByRole("gridcell").contains("0").realClick();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("117.03").should("not.exist"); // Total for the order in which quantity wasn't 0
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Quantity is equal to 0");
|
||||
|
||||
const getVisualizationSettings = (targetId) => ({
|
||||
@@ -473,7 +473,7 @@ describe("issue 17160", () => {
|
||||
|
||||
cy.url().should("include", "/dashboard");
|
||||
cy.location("search").should("eq", "?category=Doohickey&category=Gadget");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(TARGET_DASHBOARD_NAME);
|
||||
|
||||
assertMultipleValuesFilterState();
|
||||
@@ -503,7 +503,7 @@ describe("issue 17160", () => {
|
||||
cy.url().should("include", "/public/dashboard");
|
||||
cy.location("search").should("eq", "?category=Doohickey&category=Gadget");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(TARGET_DASHBOARD_NAME);
|
||||
|
||||
assertMultipleValuesFilterState();
|
||||
@@ -541,7 +541,7 @@ describe("issue 18454", () => {
|
||||
cy.findByTestId("dashcard-container").within(() => {
|
||||
cy.icon("info").trigger("mouseenter", { force: true });
|
||||
});
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText(CARD_DESCRIPTION);
|
||||
});
|
||||
});
|
||||
@@ -1386,7 +1386,7 @@ describe("issue 48878", () => {
|
||||
cy.button("Save").click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.modal()
|
||||
.last()
|
||||
.within(() => {
|
||||
|
||||
@@ -45,7 +45,7 @@ describe("scenarios > dashboard > dashboard drill", () => {
|
||||
cy.get("input").first().type("/foo/{{my_number}}/{{my_param}}", {
|
||||
parseSpecialCharSequences: false,
|
||||
});
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.get("input")
|
||||
.last()
|
||||
.type("column value: {{my_number}}", {
|
||||
@@ -111,7 +111,7 @@ describe("scenarios > dashboard > dashboard drill", () => {
|
||||
},
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Click to find out which state does Rye belong to.").click();
|
||||
|
||||
cy.log("Reported failing on v0.37.2");
|
||||
@@ -226,29 +226,29 @@ describe("scenarios > dashboard > dashboard drill", () => {
|
||||
});
|
||||
|
||||
// configure clicks on "MY_NUMBER to update the param
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("On-click behavior for each column")
|
||||
.parent()
|
||||
.parent()
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
.within(() => cy.findByText("MY_NUMBER").click());
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Go to a custom destination").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Link to")
|
||||
.parent()
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
.within(() => cy.findByText("Dashboard").click());
|
||||
H.entityPickerModal().within(() => {
|
||||
cy.findByRole("tab", { name: /Dashboards/ }).click();
|
||||
cy.findByText("end dash").click();
|
||||
});
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Available filters")
|
||||
.parent()
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
.within(() => cy.findByText("My Param").click());
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
H.popover().within(() => cy.findByText("MY_STRING").click());
|
||||
|
||||
// set the text template
|
||||
@@ -256,11 +256,11 @@ describe("scenarios > dashboard > dashboard drill", () => {
|
||||
"text: {{my_string}}",
|
||||
{ parseSpecialCharSequences: false },
|
||||
);
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Save").click();
|
||||
|
||||
// click on table value
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("text: foo").click();
|
||||
|
||||
// check that param was set to "foo"
|
||||
@@ -288,7 +288,7 @@ describe("scenarios > dashboard > dashboard drill", () => {
|
||||
cy.get("input")
|
||||
.first()
|
||||
.type(`/dashboard/${dashboardId}?my_param=Aaron Hand`, { delay: 0 });
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.get("input").last().type("Click behavior", { delay: 0 }).blur();
|
||||
cy.button("Done").click();
|
||||
});
|
||||
@@ -315,34 +315,34 @@ describe("scenarios > dashboard > dashboard drill", () => {
|
||||
});
|
||||
|
||||
// configure clicks on "MY_NUMBER to update the param
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("On-click behavior for each column")
|
||||
.parent()
|
||||
.parent()
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
.within(() => cy.findByText("MY_NUMBER").click());
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Update a dashboard filter").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Pick one or more filters to update")
|
||||
.parent()
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
.within(() => cy.findByText("My Param").click());
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
H.popover().within(() => cy.findByText("MY_STRING").click());
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Save").click();
|
||||
|
||||
// click on table value
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("111").click();
|
||||
|
||||
// check that param was set to "foo"
|
||||
cy.location("search").should("eq", "?my_param=foo");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("My Param")
|
||||
.parent()
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
.within(() => cy.findByText("foo"));
|
||||
});
|
||||
|
||||
@@ -544,9 +544,9 @@ describe("scenarios > dashboard > dashboard drill", () => {
|
||||
|
||||
H.visitDashboard(ORDERS_DASHBOARD_ID);
|
||||
// Product ID in the first row (query fails for User ID as well)
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("105").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("View details").click();
|
||||
|
||||
cy.log("Reported on v0.29.3");
|
||||
@@ -712,7 +712,7 @@ describe("scenarios > dashboard > dashboard drill", () => {
|
||||
);
|
||||
|
||||
// formatting works, so we see "USD" in the table
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("USD 111.00").click();
|
||||
cy.location("pathname").should("eq", "/it/worked");
|
||||
});
|
||||
@@ -999,7 +999,7 @@ describe("scenarios > dashboard > dashboard drill", () => {
|
||||
function postDrillAssertion(filterName) {
|
||||
cy.findByTestId("qb-filters-panel").findByText(filterName).click();
|
||||
H.popover({ testId: "filter-picker-dropdown" }).within(() => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByRole("combobox")
|
||||
.last()
|
||||
.parent()
|
||||
|
||||
@@ -68,7 +68,7 @@ describe("scenarios > dashboard > filters > query stages + temporal unit paramet
|
||||
.findByLabelText("Temporal bucket")
|
||||
.realHover()
|
||||
.click();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover().last().findByText("Week").click();
|
||||
H.getNotebookStep("summarize")
|
||||
.findByTestId("breakout-step")
|
||||
@@ -80,7 +80,7 @@ describe("scenarios > dashboard > filters > query stages + temporal unit paramet
|
||||
cy.findByText("Category").click();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByTestId("action-buttons").last().button("Summarize").click();
|
||||
H.popover().findByText("Count of rows").click();
|
||||
H.getNotebookStep("summarize", { stage: 1 })
|
||||
|
||||
@@ -711,7 +711,7 @@ export function getPopoverItem(name: string, index = 0) {
|
||||
* Without scrollIntoView() the popover may scroll automatically to a different
|
||||
* place when clicking the item (unclear why).
|
||||
*/
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
return cy.findAllByText(name).eq(index).scrollIntoView();
|
||||
}
|
||||
|
||||
@@ -836,7 +836,7 @@ export function verifyDashcardCellValues({
|
||||
for (let valueIndex = 0; valueIndex < values.length; ++valueIndex) {
|
||||
const value = values[valueIndex];
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.getDashboardCard(dashcardIndex)
|
||||
.findByRole("row")
|
||||
.findAllByRole("gridcell")
|
||||
@@ -852,7 +852,7 @@ export function verifyDashcardCellValues({
|
||||
for (let valueIndex = 0; valueIndex < values.length; ++valueIndex) {
|
||||
const value = values[valueIndex];
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByRole("gridcell").eq(valueIndex).should("have.text", value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ describe("scenarios > dashboard > chained filter", () => {
|
||||
|
||||
H.filterWidget().contains("AK").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover()
|
||||
.last()
|
||||
.within(() => {
|
||||
@@ -148,7 +148,7 @@ describe("scenarios > dashboard > chained filter", () => {
|
||||
}
|
||||
|
||||
H.filterWidget().contains("GA").click();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover()
|
||||
.last()
|
||||
.within(() => {
|
||||
|
||||
@@ -43,11 +43,11 @@ describe("support > permissions (metabase#8472)", () => {
|
||||
"Address",
|
||||
);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Done").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Save").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Orders in a dashboard").click();
|
||||
});
|
||||
|
||||
|
||||
@@ -801,7 +801,7 @@ function getTableCell(columnName, rowIndex) {
|
||||
const columnHeaderIndex = $columnHeaders
|
||||
.toArray()
|
||||
.findIndex(($columnHeader) => $columnHeader.textContent === columnName);
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
cy.findAllByRole("row")
|
||||
.eq(rowIndex)
|
||||
.findAllByTestId("cell-data")
|
||||
|
||||
@@ -35,7 +35,7 @@ describe("scenarios > dashboard > filters > date", () => {
|
||||
// Go through each of the filters and make sure they work individually
|
||||
Object.entries(DASHBOARD_DATE_FILTERS).forEach(
|
||||
([filter, { value, representativeResult }], index) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.filterWidget().eq(index).click();
|
||||
|
||||
dateFilterSelector({
|
||||
@@ -58,7 +58,7 @@ describe("scenarios > dashboard > filters > date", () => {
|
||||
// make sure the default filter works for just one of the available options
|
||||
it("should work when set as the default filter", () => {
|
||||
H.setFilter("Date picker", "Month and Year");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
|
||||
DateFilter.setMonthAndYear({
|
||||
@@ -66,7 +66,7 @@ describe("scenarios > dashboard > filters > date", () => {
|
||||
year: "2022",
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
H.popover().contains("Created At").first().click();
|
||||
|
||||
@@ -78,10 +78,10 @@ describe("scenarios > dashboard > filters > date", () => {
|
||||
});
|
||||
|
||||
// Make sure we can override the default value
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("November 2022").click();
|
||||
H.popover().contains("Jun").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("33.9");
|
||||
});
|
||||
|
||||
@@ -132,25 +132,25 @@ describe("scenarios > dashboard > filters > date", () => {
|
||||
|
||||
H.setFilter("Date picker", "All Options");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("No default").click();
|
||||
// click on Relative date range…, to open the relative date filter type tabs
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Relative date range…").click();
|
||||
// choose Next, under which the new options should be available
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Next").click();
|
||||
// click on Days (the default value), which should open the resolution dropdown
|
||||
cy.findByDisplayValue("days").click();
|
||||
// Hours should appear in the selection box (don't click it)
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("hours");
|
||||
// Minutes should appear in the selection box; click it
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("minutes").click();
|
||||
// also check the "Include this minute" checkbox
|
||||
// which is actually "Include" followed by "this minute" wrapped in <strong>, so has to be clicked this way
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Include this minute").click();
|
||||
});
|
||||
|
||||
@@ -168,7 +168,7 @@ describe("scenarios > dashboard > filters > date", () => {
|
||||
|
||||
H.popover().icon("calendar").click(); // "Time" -> "All Options"
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Sélectionner...").click(); // "Select…"
|
||||
H.popover().contains("Created At").first().click();
|
||||
|
||||
@@ -177,16 +177,16 @@ describe("scenarios > dashboard > filters > date", () => {
|
||||
editBarText: "Vous êtes en train d'éditer ce tableau de bord.",
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Date").click(); // "Date" - it's the same word in English and in French
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Exclure...").click(); // "Exclude…"
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Mois de l'année...").click(); // "Months of the year…"
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("janvier").click(); // "January"
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Ajouter un filtre").click(); // "Add filter"
|
||||
|
||||
cy.url().should("match", /\/dashboard\/\d+\?date=exclude-months-Jan/);
|
||||
|
||||
@@ -13,7 +13,7 @@ describe("scenarios > dashboard > filters > ID", () => {
|
||||
H.editDashboard();
|
||||
H.setFilter("ID");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ describe("scenarios > dashboard > filters > ID", () => {
|
||||
});
|
||||
|
||||
it("when set as the default filter", () => {
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
addWidgetStringFilter("15");
|
||||
|
||||
@@ -78,7 +78,7 @@ describe("scenarios > dashboard > filters > ID", () => {
|
||||
});
|
||||
|
||||
it("when set as the default filter", () => {
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
addWidgetStringFilter("4");
|
||||
|
||||
@@ -114,7 +114,7 @@ describe("scenarios > dashboard > filters > ID", () => {
|
||||
});
|
||||
|
||||
it("when set as the default filter", () => {
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
addWidgetStringFilter("10");
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ describe("scenarios > dashboard > filters > location", () => {
|
||||
|
||||
Object.entries(DASHBOARD_LOCATION_FILTERS).forEach(
|
||||
([filter, { value, representativeResult }], index) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.filterWidget().eq(index).click();
|
||||
addWidgetStringFilter(value);
|
||||
|
||||
@@ -50,11 +50,11 @@ describe("scenarios > dashboard > filters > location", () => {
|
||||
|
||||
it("should work when set as the default filter", () => {
|
||||
H.setFilter("Location", "Is");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
H.popover().contains("City").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
|
||||
selectFilterValueFromList("Abbeville");
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("scenarios > dashboard > filters > nested questions", () => {
|
||||
|
||||
H.editDashboard();
|
||||
H.filterWidget({ isEditing: true, name: filter.name }).click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
|
||||
// This part reproduces metabase#13186
|
||||
@@ -74,18 +74,18 @@ describe("scenarios > dashboard > filters > nested questions", () => {
|
||||
cy.button("Add filter").click();
|
||||
cy.wait("@dashcardQuery");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("2 selections");
|
||||
H.tableInteractiveBody().findAllByRole("row").should("have.length", 2);
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Doohickey").should("not.exist");
|
||||
|
||||
cy.reload();
|
||||
cy.wait("@dashcardQuery");
|
||||
|
||||
cy.location("search").should("eq", "?text=Gizmo&text=Gadget");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("2 selections");
|
||||
|
||||
H.editDashboard();
|
||||
@@ -126,10 +126,10 @@ describe("scenarios > dashboard > filters > nested questions", () => {
|
||||
|
||||
H.setFilter("ID");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("No valid fields").should("not.exist");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
H.popover().contains("ID").click();
|
||||
});
|
||||
|
||||
@@ -230,7 +230,7 @@ const filterDashboard = ({ isLabeled = false, isDropdown = false } = {}) => {
|
||||
|
||||
if (isLabeled) {
|
||||
H.popover().first().findByPlaceholderText("Enter a number").type("T");
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover().last().findByText("Twenty").click();
|
||||
H.popover().first().button("Add filter").click();
|
||||
return;
|
||||
|
||||
@@ -49,7 +49,7 @@ describe("scenarios > dashboard > filters > number", () => {
|
||||
|
||||
DASHBOARD_NUMBER_FILTERS.forEach(
|
||||
({ operator, value, representativeResult }, index) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.filterWidget().eq(index).click();
|
||||
addWidgetNumberFilter(value);
|
||||
cy.wait("@dashboardData");
|
||||
@@ -66,7 +66,7 @@ describe("scenarios > dashboard > filters > number", () => {
|
||||
it("should work when set as the default filter", () => {
|
||||
H.setFilter("Number", "Equal to");
|
||||
H.selectDashboardFilter(cy.findByTestId("dashcard"), "Tax");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
|
||||
addWidgetNumberFilter("2.07");
|
||||
|
||||
@@ -1255,7 +1255,7 @@ function addRangeFilter(
|
||||
) {
|
||||
filter(label).click();
|
||||
H.popover().findAllByRole("textbox").first().clear().type(firstValue).blur();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover().findAllByRole("textbox").last().clear().type(secondValue).blur();
|
||||
H.popover().button("Add filter").click();
|
||||
}
|
||||
@@ -1267,7 +1267,7 @@ function updateRangeFilter(
|
||||
) {
|
||||
filter(label).click();
|
||||
H.popover().findAllByRole("textbox").first().clear().type(firstValue).blur();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover().findAllByRole("textbox").last().clear().type(secondValue).blur();
|
||||
H.popover().button("Update filter").click();
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ function setSearchFilter(label) {
|
||||
H.fieldValuesCombobox().type(label);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.popover().last().findByText(label).click();
|
||||
H.popover().within(() => {
|
||||
H.fieldValuesValue(0).should("be.visible").should("contain", label);
|
||||
|
||||
@@ -40,7 +40,7 @@ describe("scenarios > dashboard > filters > SQL > date", () => {
|
||||
|
||||
Object.entries(DASHBOARD_SQL_DATE_FILTERS).forEach(
|
||||
([filter, { value, representativeResult }], index) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.filterWidget().eq(index).click();
|
||||
dateFilterSelector({
|
||||
filterType: filter,
|
||||
@@ -61,14 +61,14 @@ describe("scenarios > dashboard > filters > SQL > date", () => {
|
||||
it("should work when set as the default filter", () => {
|
||||
H.setFilter("Date picker", "Month and Year");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
DateFilter.setMonthAndYear({
|
||||
month: "Oct",
|
||||
year: "2022",
|
||||
});
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
H.popover().contains("Month and Year").click();
|
||||
H.saveDashboard();
|
||||
@@ -79,10 +79,10 @@ describe("scenarios > dashboard > filters > SQL > date", () => {
|
||||
});
|
||||
|
||||
// Make sure we can override the default value
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("October 2022").click();
|
||||
H.popover().contains("Aug").click();
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Macy Olson");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ describe("scenarios > dashboard > filters > SQL > ID", () => {
|
||||
});
|
||||
|
||||
it("when set as the default filter", () => {
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
addWidgetStringFilter("15");
|
||||
|
||||
@@ -57,7 +57,7 @@ describe("scenarios > dashboard > filters > SQL > ID", () => {
|
||||
});
|
||||
|
||||
it("when set as the default filter", () => {
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
addWidgetStringFilter("4");
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ describe("scenarios > dashboard > filters > location", () => {
|
||||
|
||||
Object.entries(DASHBOARD_SQL_LOCATION_FILTERS).forEach(
|
||||
([filter, { value, representativeResult }], index) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.filterWidget().eq(index).click();
|
||||
applyFilterByType(filter, value, { search: true });
|
||||
|
||||
@@ -60,11 +60,11 @@ describe("scenarios > dashboard > filters > location", () => {
|
||||
it("should work when set as the default filter", () => {
|
||||
H.setFilter("Location", "Is");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
H.popover().contains("Is").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
|
||||
selectFilterValueFromList("Rye", { search: true });
|
||||
|
||||
@@ -41,7 +41,7 @@ describe("scenarios > dashboard > filters > SQL > text/category", () => {
|
||||
|
||||
Object.entries(DASHBOARD_SQL_NUMBER_FILTERS).forEach(
|
||||
([filter, { value, representativeResult }], index) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.filterWidget().eq(index).click();
|
||||
addWidgetNumberFilter(value);
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ describe("scenarios > dashboard > filters > SQL > field filter > required ", ()
|
||||
|
||||
// Let's make sure the default dashboard filter is respected upon a subsequent visit from the root
|
||||
cy.visit("/collection/root");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Required Filters Dashboard").click();
|
||||
|
||||
cy.location("search").should("eq", "?category=Widget");
|
||||
|
||||
@@ -86,7 +86,7 @@ describe("scenarios > dashboard > filters > SQL > simple filter > required ", ()
|
||||
|
||||
// Let's make sure the default dashboard filter is respected upon a subsequent visit from the root
|
||||
cy.visit("/collection/root");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Required Filters Dashboard").click();
|
||||
|
||||
cy.location("search").should("eq", "?text=Bar");
|
||||
|
||||
@@ -40,7 +40,7 @@ describe("scenarios > dashboard > filters > SQL > text/category", () => {
|
||||
|
||||
Object.entries(DASHBOARD_SQL_TEXT_FILTERS).forEach(
|
||||
([filter, { value, representativeResult }], index) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.filterWidget().eq(index).click();
|
||||
|
||||
if (["Is", "Is not"].includes(filter)) {
|
||||
@@ -63,11 +63,11 @@ describe("scenarios > dashboard > filters > SQL > text/category", () => {
|
||||
it("should work when set as the default filter and when that filter is removed (metabase#20493)", () => {
|
||||
H.setFilter("Text or Category", "Is");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
H.popover().contains("Is").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
|
||||
applyFilterByType("Is", "Gizmo");
|
||||
@@ -86,7 +86,7 @@ describe("scenarios > dashboard > filters > SQL > text/category", () => {
|
||||
|
||||
applyFilterByType("Is", "Doohickey", { buttonLabel: "Update filter" });
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Rustic Paper Wallet").should("not.exist");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -80,11 +80,11 @@ describe("scenarios > dashboard > filters > text/category", () => {
|
||||
{ operator, value, representativeResult, single, negativeAssertion },
|
||||
index,
|
||||
) => {
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.filterWidget().eq(index).click();
|
||||
applyFilterByType(operator, value);
|
||||
waitDashboardCardQuery();
|
||||
// eslint-disable-next-line metabase/no-unsafe-element-filtering
|
||||
// eslint-disable-next-line no-unsafe-element-filtering
|
||||
H.filterWidget()
|
||||
.eq(index)
|
||||
.contains(single ? value.replace(/"/g, "") : /\d selections/);
|
||||
@@ -134,18 +134,18 @@ describe("scenarios > dashboard > filters > text/category", () => {
|
||||
it("should work when set as the default filter which (if cleared) should not be preserved on reload (metabase#13960)", () => {
|
||||
H.setFilter("Text or Category", "Is");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
H.popover().contains("Source").click();
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Default value").next().click();
|
||||
|
||||
applyFilterByType("Is", "Organic");
|
||||
|
||||
// We need to add another filter only to reproduce metabase#13960
|
||||
H.setFilter("ID");
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Select…").click();
|
||||
H.popover().contains("User ID").click();
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ describe("scenarios > dashboard > OLD parameters", () => {
|
||||
it("should work", () => {
|
||||
cy.findAllByText("Doohickey");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Category").click();
|
||||
H.popover().within(() => {
|
||||
cy.findByText("Gadget").click();
|
||||
@@ -70,7 +70,7 @@ describe("scenarios > dashboard > OLD parameters", () => {
|
||||
});
|
||||
|
||||
// verify that the filter is applied
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Doohickey").should("not.exist");
|
||||
});
|
||||
});
|
||||
@@ -192,7 +192,7 @@ describe("scenarios > dashboard > OLD parameters", () => {
|
||||
it("should work", () => {
|
||||
cy.findAllByText("Doohickey");
|
||||
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.contains("Category").click();
|
||||
H.popover().within(() => {
|
||||
cy.findByText("Gadget").click();
|
||||
@@ -200,7 +200,7 @@ describe("scenarios > dashboard > OLD parameters", () => {
|
||||
});
|
||||
|
||||
// verify that the filter is applied
|
||||
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
|
||||
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
|
||||
cy.findByText("Doohickey").should("not.exist");
|
||||
});
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user